You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!file.exists("trial.txt")){
download.file("https://groups.google.com/group/poppr/attach/54e0e4c1740bf/trial.txt?part=0.1&authuser=0", destfile="trial.txt")
}
if (!file.exists("strata.txt")){
download.file("https://groups.google.com/group/poppr/attach/54e0e4c1740bf/strata.txt?part=0.2&authuser=0", destfile="strata.txt")
}
suppressPackageStartupMessages(library("poppr"))
file<- read.table("trial.txt", header=T)
tfile<- t(file[,1:ncol(file)]) #transpose table
colnames(tfile) =tfile[1, ] #markers labelstfile=tfile[-1, ]
# to change rownames because the transposition don't leave the labels "ID"g<-tfileID<- rownames(g)
rownames(g) <-NULLfx<- cbind(ID,g)
View(fx)
x<- as.data.frame(fx, header=T) #trasform into a data.framelocs<-x[, -c(1, 2)]
colnames(locs) <- gsub("\\-", "_", colnames(locs))
## ind <- as.character(file$lines) # labels of the individuals# population <- as.character(file$Pop) # labels of the populationsid<- read.table("strata.txt", header=T) # add stratafile_genind<- df2genind(locs, ploidy=2, ind.names=ID, strata=id, NA.char="NA", type="codom", sep="") # conversion into a genind object
file_amova<- poppr.amova(file_genind, ~rep/year/plot)
#> #> Found 238 missing values.#> #> 3 loci contained missing values greater than 5%#> #> Removing 3 loci: JHI_Hv50k_2016_206330, JHI_Hv50k_2016_206596,#> JHI_Hv50k_2016_20687#> Warning in get_local_ploidy(x): NAs introduced by coercion#> Error in if (any(as.numeric(unlist(x@all.names, use.names = FALSE)) == : missing value where TRUE/FALSE needed
This is in reference to https://groups.google.com/d/msgid/poppr/189bdc5d-4979-4245-942f-e7ebd01f7f6f%40googlegroups.com.
Here's the worked example:
Setup (click to expand)
Created on 2018-06-12 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: