[R] help: trouble using lines()

Petr Pikal petr.pikal at precheza.cz
Thu Aug 24 16:26:46 CEST 2006


Hi

from lines help page

x, y coordinate vectors of points to join.

and lines or points simply adds lines or points to existing plot.
What do you want to plot with lines?

HTH
Petr



On 24 Aug 2006 at 14:52, Simon Pickett wrote:

Date sent:      	Thu, 24 Aug 2006 14:52:09 +0100 (BST)
From:           	"Simon Pickett" <S.Pickett at exeter.ac.uk>
To:             	"Petr Pikal" <petr.pikal at precheza.cz>
Copies to:      	r-help at stat.math.ethz.ch, Simon Pickett <s.pickett at exeter.ac.uk>
Subject:        	Re: [R] help: trouble using lines()

> Hi, thanks for replying.
> No, there arent any NA's in the original data set....
> I think I must be mis-interpreting the use of lines()?
> in the example what exactly is "y"?
> lines(y,exp(tmp[1]+tmp[2]))
> In my case tmp[1] and tmp[2] are coeficients from the model so just
> one number (not a vector) and I havent specified y.... Thanks
> everyone, Simon
> 
> 
> > Hi
> >
> > not sure but are there some NA values in your data?
> >
> > what
> >
> > length(mtf)
> > and
> > length(fitted(f2))
> >
> > tells you?
> >
> > And you need not to use assignment
> >
> > graph1 <- plot(....)
> >
> > to output a plot on screen.
> >
> >
> > HTH
> > Petr
> >
> >
> > On 24 Aug 2006 at 13:43, Simon Pickett wrote:
> >
> > Date sent:      	Thu, 24 Aug 2006 13:43:18 +0100 (BST)
> > From:           	"Simon Pickett" <S.Pickett at exeter.ac.uk>
> > To:             	R-help at stat.math.ethz.ch
> > Subject:        	[R] help: trouble using lines()
> >
> >> Hi R experts,
> >> I have been using ReML as follows...
> >> model<-lmer(late.growth~mtf+year+treat+hatch.day+hatch.day:year+hat
> >> ch. day:treat+ mtf:treat+ treat:year+ year:treat:mtf+(1|fybrood),
> >> data > A) then I wanted to plot the results of the three way
> >> interaction using lines() as follows...
> >>
> >> tmp<-as.vector(fixef(model))
> >> graph1<-plot(mtf,fitted(f2), xlab=list("Brood Size"),
> >> ylab=list("Early growth rate"), pch=16, col="darkgrey",
> >> bg="yellow") lines(y,exp(tmp[1]+tmp[2]))
> >>
> >> but no matter what I try I always get the error message
> >> "Error in xy.coords(x, y) : 'x' and 'y' lengths differ"
> >>
> >> Can anyone shed some light please?
> >> I am basically copying the methods of the pdf entitled "Linear
> >> mixed models in R" by Sřren Feodor Nielsen 20003.
> >> http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-
> >> mod els.pdf#search=%22Linear%20mixed%20models%20in%20R%22
> >>
> >>
> >>
> >>
> >>
> >> Simon Pickett
> >> PhD student
> >> Centre For Ecology and Conservation
> >> Tremough Campus
> >> University of Exeter in Cornwall
> >> TR109EZ
> >> Tel 01326371852
> >>
> >> ______________________________________________
> >> R-help at stat.math.ethz.ch 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.
> >
> > Petr Pikal
> > petr.pikal at precheza.cz
> >
> >
> 
> 
> Simon Pickett
> PhD student
> Centre For Ecology and Conservation
> Tremough Campus
> University of Exeter in Cornwall
> TR109EZ
> Tel 01326371852
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list