Description Usage Arguments Value Examples
The standard way within R of pulling values out of a named vector really bogs down on large data sets. So I will do this instead.
1 | make_it_012(M)
|
M |
a character matrix of variant call format (VCF) genotypes and no dimnames. Allowable values are "0/0", and "0|0", which get coverted to integer 0; "0/1", "0|1", "1/0", and "1|0", which get converted to integer 1; and "1/1", and "1|1", which get converted to integer 2. Everything else gets converted to -1 to denote missing data. |
An integer matrix of values which are 0, 1, 2, or -1.
1 2 3 4 | # get an 012 matrix from the lobster data
tmp <- t(vcfR::extract.gt(lobster_buz_2000, element = "GT"))
dimnames(tmp) <- NULL
g <- make_it_012(tmp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.