<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
{font-family:Helvetica}
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:windowtext}
.MsoChpDefault
{font-family:"Calibri","sans-serif"}
@page WordSection1
{margin:72.0pt 72.0pt 72.0pt 72.0pt}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-GB" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
<div><font size="2">Hi there, <br>
<br>
yes, na.replace has been removed in adegenet 2.0.0. <br>
<br>
Instead, you can use:<br>
tab(x, NA.method="mean")<br>
<br>
where 'x' is your genind. If you want frequencies, you will need to add 'freq=TRUE'. See ?tab, and the basics tutorial for more info on data handling:<br>
<a href="https://github.com/thibautjombart/adegenet/wiki/Tutorials" target="_blank">https://github.com/thibautjombart/adegenet/wiki/Tutorials</a><br>
<br>
Cheers<br>
Thibaut<br>
</font>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"><br>
</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF376537"><font face="Tahoma" size="2" color="#000000"><b>From:</b> adegenet-forum-bounces@lists.r-forge.r-project.org [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Raman Lawal [plxral@nottingham.ac.uk]<br>
<b>Sent:</b> 15 July 2015 15:08<br>
<b>To:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> [adegenet-forum] NA.REPLACE<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.5pt; font-family:"Helvetica","sans-serif"; color:black; background:white">I have tried to prepare all necessary files but wanted to remove the NA using the na.replace option
of the ade4 as seen in command below. When I ran </span></span>test<- na.replace(genind_ABCDEFGH,"mean", quiet=FALSE), I get “Error: could not find function "na.replace". I am not certainly sure what I was doing wrong. Could you please advise me on what to
do.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="color:black">library(adegenet)</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">datan<- as.numeric(data4)</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">pop<-data4@phdata$pop</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">genind_ABCDEFGH<-as.genind(datan,pop)</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">rm(data4)</span></p>
<p class="MsoNormal"><span style="color:black">rm(datan)</span></p>
<p class="MsoNormal"><span style="color:black">#rm(pop)</span></p>
<p class="MsoNormal"><span style="color:black">library(ade4)</span></p>
<p class="MsoNormal"><span style="color:black">## Replacing NAs</span></p>
<p class="MsoNormal"><span style="color:black">test<- na.replace(genind_ABCDEFGH,"mean", quiet=FALSE)</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black"> LAWAL</span></p>
</div>
<pre>This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.
Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
</pre>
</div>
</div>
</div>
</body>
</html>