blockvector: Block Vector

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
3
4
5

Arguments

data

a vector

parts

vector of partitions

dims

integer indicating the number of blocks

x

an R object

Value

An object of class "blockvector"

See Also

blockmatrix, vector

Examples

 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

gastonstat/blockberry documentation built on May 16, 2019, 5:44 p.m.