[R] strip function
Deepayan Sarkar
deepayan.sarkar at gmail.com
Wed Oct 4 17:27:42 CEST 2006
On 10/4/06, jessica.gervais at tudor.lu <jessica.gervais at tudor.lu> wrote:
> Hi,
>
> I would like to asign titles into strip of a panel of curves designed
> thanks to a xyplot function (lattice package)
> I ve tried the "strip" function, ...
>
> here is my code
> I would like to write in the strip of each panel conditionning varialbe
> (here, it is data[,1])
> xyplot (data[,3] ~ data[,2] | data[,1] , strip.default (which.given=1,
> which.panel = c(1:15), var.name= c
> ("26","28","15","2","31","10","16","21","21.5","5","17","14","7","8","30"),
> factor.levels=c("26","28","15","2","31","10","16","21","21.5","5","17","14","7","8","30"),strip.names=c(1,0),strip.levels=c(0,0)),panel=function(x,y)
> {
> panel.xyplot(x,y,pch=4,col=3)
> type = c("p", "r")
> COEFF<-coef(lm(log(y)~x))
> panel.curve(exp(COEFF[1]+COEFF[2]*x),col=4)
> a<-round(COEFF[1],digit=2)
> b<-round(COEFF[2],digit=2)
> formula<-as.name(paste("y=exp(",a,b,"x)",sep=""))
> panel.text(10,700,formula)
> })
>
>
> I cannot get anny result exept one page with a big strip on which is
> written 26 and then the curve without specified strip
>
> CAn anyone give me some advices ?
Yes;
(1) acquire some rudimentary R programming skills, which you currently
do not seem to have. See the links under "Documentation" in
http://www.r-project.org for some possible starting points.
(2) read the posting guide at
http://www.R-project.org/posting-guide.html, and follow its
suggestions. In particular, give a _reproducible example_ and describe
what you _want to do_, not some badly written code which fails to do
it (in fact I'm surprised that your code does anything at all).
Deepayan
More information about the R-help
mailing list