Description Usage Arguments Details Value Author(s) See Also Examples

These functions bind together two or more objects of class
`"snp.matrix"`

or `"X.snp.matrix"`

.

1 2 |

`...` |
Objects of class |

These functions reproduce the action of the standard functions
`cbind`

and `rbind`

. These are constrained to
work by recursive calls to the generic functions `cbind2`

and `rbind2`

which take just two arguments. This
is somewhat inefficient in both time and memory use when binding more
than two objects, so the functions `snp.cbind`

and
`snp.rbind`

, which take multiple arguments, are also supplied.

When matrices are bound together by column, row names must be identical,
column names must not be duplicated and, for objects of class
`X.snp.matrix`

the contents of the `Female`

slot much match.
When matrices are bound by row,
column names must be identical. and duplications of row names generate
warnings.

A new matrix, of the same type as the input matrices.

David Clayton [email protected]

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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | ```
data(testdata)
# subsetting ( Autosomes[c(1:9,11:19,21:29),] ) is quicker. this is just for illustrating
# rbind and cbind
first <- Autosomes[1:9,]
second <- Autosomes[11:19,]
third <- Autosomes[21:29,]
result1 <- rbind(first, second, third)
result2 <- snp.rbind(first, second, third)
all.equal(result1, result2)
result3 <- Autosomes[c(1:9,11:19,21:29),]
all.equal(result1, result3)
first <- Autosomes[,1:9]
second <- Autosomes[,11:19]
third <- Autosomes[,21:29]
result1 <- cbind(first, second, third)
result2 <- snp.cbind(first, second, third)
all.equal(result1, result2)
result3 <- Autosomes[,c(1:9,11:19,21:29)]
all.equal(result1, result3)
first <- Xchromosome[1:9,]
second <- Xchromosome[11:19,]
third <- Xchromosome[21:29,]
result1 <- rbind(first, second, third)
result2 <- snp.rbind(first, second, third)
all.equal(result1, result2)
result3 <- Xchromosome[c(1:9,11:19,21:29),]
all.equal(result1, result3)
first <- Xchromosome[,1:9]
second <- Xchromosome[,11:19]
third <- Xchromosome[,21:29]
result1 <- cbind(first, second, third)
result2 <- snp.cbind(first, second, third)
all.equal(result1, result2)
result3 <- Xchromosome[,c(1:9,11:19,21:29)]
all.equal(result1, result3)
``` |

chopsticks documentation built on Nov. 1, 2018, 3:36 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.