<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 12pt; color: #000000"><div>Could it be that it goes through because <a href="https://github.com/thibautjombart/adegenet/blob/master/R/glFunctions.R#L434" data-mce-href="https://github.com/thibautjombart/adegenet/blob/master/R/glFunctions.R#L434">NAs are replaced by 0</a>?</div><div><br></div><div data-marker="__SIG_PRE__">----<br>In god we trust, all others bring data.</div><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Mike Donaldson" <michaeldonaldson@trentu.ca><br><b>To: </b>adegenet-forum@lists.r-forge.r-project.org<br><b>Sent: </b>Friday, January 19, 2018 4:46:52 PM<br><b>Subject: </b>[adegenet-forum] Do you need to replace missing data before performing a glPca?<br></div><br><div data-marker="__QUOTED_TEXT__"><div dir="ltr"><div>Hello, </div><br><div>I imported a vcf file and converted it to a genlight object using vcfR as follows:</div><br><div><span face="monospace, monospace" data-mce-style="font-family: monospace, monospace;" style="font-family: monospace, monospace;">gl.x <- vcfR2genlight(file.vcf)</span></div><div><span face="monospace, monospace" data-mce-style="font-family: monospace, monospace;" style="font-family: monospace, monospace;">ploidy(gl.x) <- 2</span></div><div><span face="monospace, monospace" data-mce-style="font-family: monospace, monospace;" style="font-family: monospace, monospace;">pop <- read.csv("popfile.csv", sep=",", header=TRUE)</span></div><div><span face="monospace, monospace" data-mce-style="font-family: monospace, monospace;" style="font-family: monospace, monospace;">pop(gl.x) <- pop$Pop</span></div><br><div>The dataset has ~10% missing data. When using the glPca function, do you need to first convert the missing data to the mean and transform it based on frequency using the tab function (<span face="monospace, monospace" data-mce-style="font-family: monospace, monospace;" style="font-family: monospace, monospace;">tab(gl.x, NA.method="mean", freq=TRUE)</span>), or does that happen "behind the scenes"?</div><br><div>I ask because the glPca will proceed without that conversion, while a dudi.pca will not. </div><br><div>Thank you for your time,</div><div>Mike</div>
</div>
<br>_______________________________________________<br>adegenet-forum mailing list<br>adegenet-forum@lists.r-forge.r-project.org<br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum<br></div></div></body></html>