vpartition {acopula} | R Documentation |
Vector partitioning
Description
Split a vector to subvectors of specified lengths.
Usage
vpartition(x, lengths, matrixify = TRUE)
Arguments
x |
vector to be splitted. |
lengths |
numeric vector. Lengths of the subvectors. |
matrixify |
logical. Whether to return matrix if lengths are identical. |
Details
If sum(lengths)>length(x)
holds true, the extra places are filled with NA
s.
Value
List of numeric vectors, or a matrix if all lengths are equal.
Author(s)
Tomas Bacigal
Examples
vpartition(1:10,c(4,5,2))
[Package acopula version 0.9.4 Index]