[R-sig-eco] R-sig-ecology (72-19): Plot question

Rodrigues rodriguesmsb at gmail.com
Mon Mar 24 21:34:14 CET 2014


Dear Michal,

In this case they have only two variables: (i) time spend in each prey and
(ii) prey type. Would be better if he use bar graphs. So if are necessary
show the time spend for each spider I suggest the follow commands:



spider2=as.factor(spider)
plot(time~prey)
library(gplots)
mt=tapply(time,prey,mean)
ept=tapply(time,prey,sd)/sqrt(tapply(time,prey,length))
barplot2(mt,plot.ci=T,ci.u=mt+ept,ci.l=mt-ept,ylim=c(0,200),ylab="Mean of
time spending in each prey")

barplot(tapply(time,list(prey,spider),mean),beside=T,ylim=c(0,250),col=c("Gray","Gray10","Gray20","Gray30","Gray40","Gray50"),xlab="Spider",ylab="Time
spend in each prey")
levels(prey)
labs=c("Ant","CocKroach","Fly","Isopod","Termite")
legend("topleft",labs,fill=c("Gray","Gray10","Gray20","Gray30","Gray40","Gray50"),bty="n")

If u dont like bar use stripchart function for bars :)




--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Re-R-sig-ecology-72-19-Plot-question-tp7578769p7578775.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



More information about the R-sig-ecology mailing list