PCoA散点图 - 包adegenet中种群的个体符号

时间:2021-02-26 20:34:38

I am new to R, and am running PCoAs using the package Adegenet. I would like each of my populations to be given a different symbol, and have but unsuccessful at doing so (I can assign different colors to each population, but not symbols). I've tried the following:

我是R的新手,正在使用Adegenet软件包运行PCoAs。我希望我的每个人都能得到一个不同的符号,但这样做却不成功(我可以为每个人分配不同的颜色,但不是符号)。我尝试过以下方法:

X<-scaleGen(data, scale=FALSE, miss="mean")
pcoX<-dudi.pco(dist(X), scannf=FALSE, nf=3)
col<-palette(c("black", "gray27", "gray45", "gray71"))
s.class(pcoX$li, pop(data), col=col,xax=1, yax=3, axesell=FALSE, grid=FALSE, 
+         cstar=0, pch=(c(16:19)))

but rather than each population being given a different symbol, each symbol seems randomly distributed among my four populations. Any suggestions to fix this problem?

但是,不是每个人都被赋予不同的符号,每个符号似乎随机分布在我的四个人群中。有什么建议来解决这个问题?

Thanks

1 个解决方案

#1


Try this...

X<-scaleGen(data, scale=FALSE, miss="mean")
pcoX<-dudi.pco(dist(X), scannf=FALSE, nf=3)

col<-palette(c("black", "gray27", "gray45", "gray71"))

temp <- as.integer(pop(data))
mypch <- c(16:19)[temp]

s.class(pcoX$li, pop(data), col=col,xax=1, yax=3, axesell=FALSE, grid=FALSE, 
+         cstar=0, pch=mypch)

#1


Try this...

X<-scaleGen(data, scale=FALSE, miss="mean")
pcoX<-dudi.pco(dist(X), scannf=FALSE, nf=3)

col<-palette(c("black", "gray27", "gray45", "gray71"))

temp <- as.integer(pop(data))
mypch <- c(16:19)[temp]

s.class(pcoX$li, pop(data), col=col,xax=1, yax=3, axesell=FALSE, grid=FALSE, 
+         cstar=0, pch=mypch)