[adegenet-forum] NA.REPLACE

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Jul 15 17:33:13 CEST 2015


Hi there,

yes, na.replace has been removed in adegenet 2.0.0.

Instead, you can use:
tab(x, NA.method="mean")

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:
https://github.com/thibautjombart/adegenet/wiki/Tutorials

Cheers
Thibaut

________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Raman Lawal [plxral at nottingham.ac.uk]
Sent: 15 July 2015 15:08
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] NA.REPLACE

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 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.

library(adegenet)

datan<- as.numeric(data4)

pop<-data4 at phdata$pop

genind_ABCDEFGH<-as.genind(datan,pop)

rm(data4)
rm(datan)
#rm(pop)
library(ade4)
## Replacing NAs
test<- na.replace(genind_ABCDEFGH,"mean", quiet=FALSE)

 LAWAL

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20150715/cc7882bb/attachment.html>


More information about the adegenet-forum mailing list