Hi,

On Wednesday, September 11, 2013, Stas Malavin wrote:

> 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)
>
> There's also an error bar function in the Hmisc package that
simplifies the process.



> For customizing the view see ?points and ?arrows
> BTW, pch=as.numeric(Prey)) is meaningless


Unless Prey is a factor, then it will give sequential plotting characters
according to the factor levels.

 Sarah


> Hope this helps,
> Stas
>
>
>
> On Wed, Sep 11, 2013 at 5:50 AM, Luis Fernando García
> <luysgarcia@gmail.com <javascript:;>>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!
> ]]
>
>

-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

	[[alternative HTML version deleted]]

