Obtain the Number of Possible Peumuations from a Random Assignment Declaration

obtain_num_permutations(declaration)

Arguments

declaration

A random assignment declaration, created by declare_ra.

Value

a scalar

Examples

# complete declaration <- declare_ra(N = 4) perms <- obtain_permutation_matrix(declaration) dim(perms)
#> [1] 4 6
obtain_num_permutations(declaration)
#> [1] 6
# blocked block_var <- c("A", "A", "B", "B", "C", "C", "C") declaration <- declare_ra(block_var = block_var) perms <- obtain_permutation_matrix(declaration) dim(perms)
#> [1] 7 24
obtain_num_permutations(declaration)
#> [1] 24
# clustered clust_var <- c("A", "B", "A", "B", "C", "C", "C") declaration <- declare_ra(clust_var = clust_var) perms <- obtain_permutation_matrix(declaration) dim(perms)
#> [1] 7 6
obtain_num_permutations(declaration)
#> [1] 6
# large declaration <- declare_ra(20) choose(20, 10)
#> [1] 184756
perms <- obtain_permutation_matrix(declaration) dim(perms)
#> [1] 20 10000