snp_fastImputeSimple | R Documentation |
Fast imputation via mode, mean, sampling according to allele frequencies, or 0.
snp_fastImputeSimple(
Gna,
method = c("mode", "mean0", "mean2", "random"),
ncores = 1
)
Gna |
A FBM.code256
(typically |
method |
Either |
ncores |
Number of cores used. Default doesn't use parallelism.
You may use |
A new FBM.code256
object (same file, but different code).
snp_fastImpute()
bigsnp <- snp_attachExtdata("example-missing.bed")
G <- bigsnp$genotypes
G[, 2] # some missing values
G2 <- snp_fastImputeSimple(G)
G2[, 2] # no missing values anymore
G[, 2] # imputed, but still returning missing values
G$copy(code = CODE_IMPUTE_PRED)[, 2] # need to decode imputed values
G$copy(code = c(0, 1, 2, rep(0, 253)))[, 2] # "imputation" by 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.