Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

obtain_num_permutations

Obtain the Number of Possible Permutations from a Random Assignment Declaration


Description

Obtain the Number of Possible Permutations from a Random Assignment Declaration

Usage

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)
obtain_num_permutations(declaration)

# blocked

blocks <- c("A", "A", "B", "B", "C", "C", "C")
declaration <- declare_ra(blocks = blocks)
perms <- obtain_permutation_matrix(declaration)
dim(perms)
obtain_num_permutations(declaration)

# clustered

clusters <- c("A", "B", "A", "B", "C", "C", "C")
declaration <- declare_ra(clusters = clusters)
perms <- obtain_permutation_matrix(declaration)
dim(perms)
obtain_num_permutations(declaration)

# large

declaration <- declare_ra(20)
choose(20, 10)
perms <- obtain_permutation_matrix(declaration)
dim(perms)

randomizr

Easy-to-Use Tools for Common Forms of Random Assignment and Sampling

v0.20.0
MIT + file LICENSE
Authors
Alexander Coppock [aut, cre], Jasper Cooper [ctb], Neal Fultz [ctb] (C version of restricted partitions)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.