Number of Partitions of a Vector into Groups
comboGroupsCount.RdCalculate the number of partitions of a vector into groups. See the related integer sequences A025035-A025042 at OEIS (E.g. A025036 for Number of partitions of \( 1, 2, ..., 4n \) into sets of size 4.)
Arguments
- v
Source vector. If
vis a positive integer, it will be converted to the sequence1:v. Ifvis a negative integer, it will be converted to the sequencev:-1. All atomic types are supported (Seeis.atomic).- numGroups
An Integer. The number of groups that the vector will be partitioned into. The default is
NULL. If provided andgrpSizeisNULL, it must divide the length of v (if v is a vector) or v (if v is a scalar).- grpSizes
A vector of whole numbers representing the size of each group. The default is
NULL. If provided, the sum of the elements must total the length of v (if v is a vector) or v (if v is a scalar).