Patitions an object into different sets
partition.RdPartitions an object into subsets of length defined in the sep
argument.
Arguments
- x
object to be partitioned.
- sep
determines how many elements should go into each set. The sum of
sepshould be equal to the length ofx.- rowsep
determins how many rows should go into each set. The sum of
rowsepmust equal the number of rows inx.- colsep
determins how many columns should go into each set. The sum of
colsepmust equal the number of columns inx.- ...
arguments used in other methods of
partition.
Examples
a <- 1:7
partition.vector(a, sep=c(1,3,2,1))
#> $`1`
#> [1] 1
#>
#> $`2`
#> [1] 2 3 4
#>
#> $`3`
#> [1] 5 6
#>
#> $`4`
#> [1] 7
#>