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

Michał Bogdziewicz michalbogdziewicz at gmail.com
Mon Mar 24 22:12:52 CET 2014


Bar plots are not necessety the best way to show data:

2014-03-24 21:34 GMT+01:00 Rodrigues <rodriguesmsb at gmail.com>:
> 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.
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



-- 
Michał Bogdziewicz
Department of Systematic Zoology
Institute of Environmental Biology
Faculty of Biology
Adam Mickiewicz University
Umultowska 89, 61-614 Poznan
POLAND

Google Scholar Profile:
http://scholar.google.pl/citations?user=ljM32CsAAAAJ&hl=pl&oi=ao
Research Gate Profile:
https://www.researchgate.net/profile/Michat_Bogdziewicz/?ev=hdr_xprf



More information about the R-sig-ecology mailing list