io.snp_unphased | R Documentation |
IO handler for SNP unphased matrix.
io.snp_unphased(filename, read_mode = "file")
filename |
File name. |
read_mode |
Reading mode. |
IO handler for SNP unphased data.
n <- 123
s <- 423
filename <- paste(tempdir(), "snp_unphased_dummy.snpdat", sep="/")
handle <- io.snp_unphased(filename)
mat <- matrix(
as.integer(sample.int(
3, n * s,
replace=TRUE,
prob=c(0.7, 0.2, 0.1)
) - 1),
n, s
)
impute <- double(s)
handle$write(mat, "mean", impute, 1)
handle$read()
file.remove(filename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.