Hello R experts,
  I am trying to plot ordiellipse for my data but the col according to
factors.

Metabolites_raw= read.csv(file.choose(), head = TRUE) #file
21Metabolites.csv

Metabolites_t=t(Metabolites_raw[,2:82])

ord <- metaMDS(Metabolites_t, distance="bray")

symbol=as.numeric(Metab_metadata$LandType)

col.list <- c("red","slategray","seagreen","cyan","pink","brown","black",
"blue","yellow","magenta")

 palette(col.list)

 plot(ord$points, col = Metab_metadata$Day+2,pch=symbol, xlim=c(-0.3,0.35))

legend(.28,.25, c("0", "8", "16"),fill = c(2, 10,18))

# draw dispersion ellipses around data points

groupz <-c(2,10,18)

for(i in seq(groupz)) {

ordiellipse(ord, Metab_metadata$Day, kind = "sd", label = T,col=groupz[i],
show.groups=groupz[i])

}

Now here I get the error

Error in text.default(...) : no coordinates were supplied (But sometimes
same code works. I am not sure what am I doing wrong.)

Data files are attached.

Any help will be really great.

Thanks,

Mitra
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to