R/utils_geno.R
rbindSnpFlexible.RdCombines multiple SnpMatrix objects by rows, automatically handling differing SNP columns, optimized for large matrices.
rbindSnpFlexible(...)A single SnpMatrix object with all rows combined.
m1 <- methods::new("SnpMatrix",
matrix(as.raw(1:3), nrow = 2, ncol = 3,
dimnames = list(c("S1", "S2"),
c("SNP1", "SNP2", "SNP3"))))
m2 <- methods::new("SnpMatrix",
matrix(as.raw(1:3), nrow = 2, ncol = 2,
dimnames = list(c("S3", "S4"),
c("SNP2", "SNP4"))))
#> Warning: data length [3] is not a sub-multiple or multiple of the number of rows [2]
rbindSnpFlexible(m1, m2)
#> A SnpMatrix with 4 rows and 4 columns
#> Row names: S1 ... S4
#> Col names: SNP1 ... SNP4