rbind.tableMatrix: Combine by rows

Description Usage Arguments Value Examples

Description

tableMatrix method, binds rows of tableMatrix objects. If matrix parts have the same dimensions, it combines rows in table and matrix parts using data.table and matrix rbind methods respectively. In case when dimensions differ it combines rows in table part and adds new matrix to the matrix part.

Usage

1
2
## S3 method for class 'tableMatrix'
rbind(..., use.names = TRUE, fill = FALSE)

Arguments

...

tableMatrix objects.

use.names

Passed to rbind.data.table.

fill

Passed to rbind.data.table.

Value

tableMatrix object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
data(images8By8)
dim(images8By8)

data(images10By10)
dim(images10By10) 

# Create tableMatrix objects from images8By8 and images10By10
TM1 <- tableMatrix(images8By8, 1:3, 4:ncol(images8By8))
TM2 <- tableMatrix(images10By10, 1:3, 4:ncol(images10By10))

# Combining tableMatrix objects with same dimensions
TM <- rbind(TM1, TM1)
# Combined table part
tab(TM)
# One matrix in the matrix part
length(mat(TM))
# One dimension type
matDim(TM)

# Combining tableMatrix objects with different dimensions
TM <- rbind(TM1, TM2)
# Combined table part
tab(TM)
# Two matrices in the matrix part
length(mat(TM))
# Two dimension types
matDim(TM)

tableMatrix documentation built on May 1, 2019, 8:42 p.m.