[adegenet-forum] Replacing NAs in genlight object

Samuel Weaver weave271 at umn.edu
Sun Mar 3 19:53:16 CET 2019


I'm trying to change NAs in my dataset to the mean allele frequency to run
various PopGen analyses through adegenet, but have been having trouble.
Commands start below.

Data<-vcfR2genlight(MyVcf)
Data
/// GENLIGHT OBJECT /////////

 // 11 genotypes,  5,467 binary SNPs, size: 877.8 Kb
 7647 (12.72 %) missing data

 // Basic content
   @gen: list of 11 SNPbin

 // Optional content
   @ind.names:  11 individual labels
   @loc.names:  5467 locus labels
   @chromosome: factor storing chromosomes of the SNPs
   @position: integer storing positions of the SNPs
   @other: a list containing: elements without names

I then try to run the command listed in the tutorial and elsewhere on the
forum, which is as follows:

tab(Data, NA.method="mean").

This, however, does nothing to replace the NA values in the original "Data"
genlight object. I've looked for hours on how to do this with no avail, so
any help would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20190303/cabd61d5/attachment.html>


More information about the adegenet-forum mailing list