Description Usage Arguments Value See Also Examples
blockvector
creates a block-vector from the given
set of values
as.bvector
attempts to turn its
argument into a block-vector
is.bvector
tests
if its argument is a (strict) block-vector
1 2 3 4 5 | blockvector(data, parts = NULL, dims = NULL)
is.blockvector(x)
as.blockvector(x)
|
data |
a vector |
parts |
vector of partitions |
dims |
integer indicating the number of blocks |
x |
an R object |
An object of class "blockvector"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # some vectors
vnum = runif(10)
vlog = sample(c(TRUE, FALSE), size=10, replace=TRUE)
vstr = letters[1:10]
# convert vectors into block-vectors
bnum = blockvector(vnum, 10, 1)
blog = blockvector(vlog, c(5,5), 2)
bstr = blockvector(vstr, c(3,3,4), 3)
# test if objects are blockvectors
is.bvector(vnum) # FALSE
is.bvector(bnum) # TRUE
# generate a vector
v = 1:10
# convert 'v' into a block-vector (one block)
bv = as.bvector(v)
bv
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.