partition.Rd
Partitions an object into subsets of length defined in the sep
argument.
partition.vector(x, sep, ...)
partition.matrix(x, rowsep, colsep, ...)
object to be partitioned.
determines how many elements should go into each set. The
sum of sep
should be equal to the length of x
.
determins how many rows should go into each set. The
sum of rowsep
must equal the number of rows in x
.
determins how many columns should go into each set. The
sum of colsep
must equal the number of columns in x
.
arguments used in other methods of partition
.
A list of equal length as sep
containing the partitioned objects.
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
#>