Hi Luis, Does this do what you want?
SD <- aggregate(Eaten, by = list(Density), FUN = sd) AV <- aggregate(Eaten, by = list(Density), FUN = mean) newyv <- predict(model, list(Density = SD[,1])) # mean points: points(SD[,1], AV[,2], pch = 19) # sd: arrows(x0 = SD[,1], y0 = newyv, x1 = SD[,1], y1 = newyv + SD[,2], angle = 90) arrows(x0 = SD[,1], y0 = newyv, x1 = SD[,1], y1 = newyv - SD[,2], angle = 90) For customizing the view see ?points and ?arrows BTW, pch=as.numeric(Prey)) is meaningless Hope this helps, Stas On Wed, Sep 11, 2013 at 5:50 AM, Luis Fernando García <luysgar...@gmail.com>wrote: > Hello R friends, > > I have a serious issue on R. I have some data about the functional response > of a spider, over some prey, I am really needing to plot the data and add > mean and > SD and or SE bars to the graph but I have not found out how to do it! > > Does some of you have some idea about how to do it? > > Here it goes my data and what I have done (data table is attached) > > lycosa=read.table("C:\\Users\\Luis Fernando > Garcia\\R\\RFlycosa.txt",header=T) > attach(lycosa) > model<-nls(Eaten~SSmicmen(Density,a,b)) > plot(Density,Eaten,pch=as.numeric(Prey)) > xv<-seq(0,10,1) > yv<-predict(model,list(Density=xv)) > lines(xv,yv) > > please, if somebody knows how to do this I would be very thanked! I would > like my data could look like the figure 8 of this paper. > http://www.sciencedirect.com/science/article/pii/S1382668913001312 > > All the best! > > _______________________________________________ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > [[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology