[R] problem solved in augented plot

Mir Salam mir.salam at uef.fi
Fri May 16 11:17:41 CEST 2014


Dear Med venlig hilsen,

Thanks for your valuable time and help. Finally I solved the peoblem based on your help. 


Best regards
Abdus Salam
Project Manager (ENPI)
PhD student
University of Eastern Finland (UEF)
Finland

________________________________________
From: Frede Aakmann Tøgersen <frtog at vestas.com>
Sent: Friday, May 16, 2014 11:29 AM
To: Mir Salam; r1
Subject: RE: needs help in augented plot

Hi

strip.custom() is a function in the lattice package so you need to load that package first

library("lattice").

You could also consider to not have that many panels on one page. Use the layout argument of the lattice plot functions to set the number of rows and columns of panel. See ?xyplot which is implicitly called when you plot an augPred  object.

Something like this

plot(augPred(fm3cham.nlme),strip = strip.custom(par.strip.text = list(cex = 0.5)), layout = c(3,4))

Here 3 is the number of columns and 4 is the number of rows.

Best regards

Frede


Yours sincerely / Med venlig hilsen


Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender.


> -----Original Message-----
> From: Mir Salam [mailto:mir.salam at uef.fi]
> Sent: 16. maj 2014 09:46
> To: r1
> Cc: Frede Aakmann Tøgersen
> Subject: FW: needs help in augented plot
>
> Dear Med venlig hilsen and all
> Thanks a lot for your attention and valuable codes.  I produced the graph
> using the follwing code. I fitted mixed effects dominant height model. The
> grpah is showing plot-specific dominant height against Age.
>
> aspdomH2<-groupedData(domH2~age|plotno,data=aspdomH2)
> fm3cham.nlme<-nlme(domH2~cham(age,b0,b1,b2),
>                data=aspdomH22,
>                fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
> 1+origin+soilcharacter),
>                random = b0+b2~1|plotno,
>                start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
>                weights=varPower(form = ~age, 0.5),
>                correlation=corAR1())
>
> windows()
> plot(augpred(fm3cham.nlme)
>
> Note: if you look the attched graph, the highlighted heading of the text of
> the each plot (i.e. ASS/3, HASS/3.....) are too big front size. I want to reduce
> the front size. Actually, this is my plot id. To overcome the problem I used
> your suggested code, but I got the folllowing error
>
> plot(augPred(fm3cham.nlme),strip = strip.custom(par.strip.text = list(cex =
> 0.5)))
>
> Error in plot.augPred(augPred(fm3cham.nlme), strip =
> strip.custom(par.strip.text = list(cex = 0.5))) :
>   could not find function "strip.custom"
>
> how I will fix the problem?
>
> Thanks for your help. Actually I am new in R
>
> Best regards
> Salam
>
>
>
>
>
>
>
> ________________________________________
> From: Frede Aakmann Tøgersen <frtog at vestas.com>
> Sent: Thursday, May 15, 2014 3:09 PM
> To: Mir Salam; R-help at r-project.org
> Subject: RE: needs help in augented plot
>
> Dear Salam
>
> So you apparently did not read the posting guide as you were supposed to
> when joining this list????
>
> Every email from the list has this footer:
>
> > ______________________________________________
> > R-help at r-project.org 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.
>
> So why didn't you provide commented, minimal, self-contained,
> reproducible code????
>
> Well the man page for augPred has this example:
>
>      fm1 <- lme(Orthodont, random = ~1)
>      augFM1 <- augPred(fm1, length.out = 2, level = c(0,1))
>
> From this you can
>
> plot(augFM1)
>
> Is it something like this you want:
>
> plot(augFM1, par.settings = list(par.main.text = list(cex = 0.5)), main =
> "Testing")
>
> ????
>
> Or this:
>
> plot(augFM1, strip = strip.custom(par.strip.text = list(cex = 0.5)))
>
> ????
>
> If the latter I will leave it as an exercise to you to change the default strip
> height. Google for r lattice strip height
>
> Have a nice day.
>
>
> Yours sincerely / Med venlig hilsen
>
>
> Frede Aakmann Tøgersen
> Specialist, M.Sc., Ph.D.
> Plant Performance & Modeling
>
> Technology & Service Solutions
> T +45 9730 5135
> M +45 2547 6050
> frtog at vestas.com
> http://www.vestas.com
>
> Company reg. name: Vestas Wind Systems A/S
> This e-mail is subject to our e-mail disclaimer statement.
> Please refer to www.vestas.com/legal/notice
> If you have received this e-mail in error please contact the sender.
>
>
> > -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org]
> > On Behalf Of Mir Salam
> > Sent: 15. maj 2014 13:22
> > To: R-help at r-project.org
> > Subject: [R] needs help in augented plot
> >
> > Dear all,
> >
> > I have problem in augmented plot to reduce the text (font ) size in heading
> > of each plot. I have 68 plots and in augmented plot, I have heading of 68
> plots
> > in a panel. The headline of each plot  coded with plot characteristic, but the
> > text seems to be big. How I will reduce the text size?
> >
> > R code
> >
> > plot(augPred(fm3cham.nlme),cex=0.5))
> >
> >
> > Best regards
> > Salam
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org 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.
>
> ________________________________________
> From: Mir Salam
> Sent: Thursday, May 15, 2014 9:37 PM
> To: Frede Aakmann Tøgersen
> Cc: r-help-owner at r-project.org
> Subject: RE: needs help in augented plot
>
> Dear Med venlig hilsen
> Thanks a lot for your attention and valuable codes.  I produced the graph
> using the follwing code.
>
> aspdomH2<-groupedData(domH2~age|plotno,data=aspdomH2)
> fm3cham.nlme<-nlme(domH2~cham(age,b0,b1,b2),
>                data=aspdomH22,
>                fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
> 1+origin+soilcharacter),
>                random = b0+b2~1|plotno,
>                start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
>                weights=varPower(form = ~age, 0.5),
>                correlation=corAR1())
>
> windows()
> plot(augpred(fm3cham.nlme)
>
> Note: if you look the attched graph, the highlighted heading of the text of
> the each plot (i.e. ASS/3, HASS/3.....) are too big front size. I want to reduce
> the front size. Actually, this is my plot id. To overcome the problem I used
> your suggested code, but I got the folllowing error
>
> plot(augPred(fm3cham.nlme),strip = strip.custom(par.strip.text = list(cex =
> 0.5)))
>
> Error in plot.augPred(augPred(fm3cham.nlme), strip =
> strip.custom(par.strip.text = list(cex = 0.5))) :
>   could not find function "strip.custom"
>
> how I will fix the problem?
>
> Thanks for your help. Actually I am new in R
>
> Best regards
> Salam
>
>
>
>
>
>
>
> ________________________________________
> From: Frede Aakmann Tøgersen <frtog at vestas.com>
> Sent: Thursday, May 15, 2014 3:09 PM
> To: Mir Salam; R-help at r-project.org
> Subject: RE: needs help in augented plot
>
> Dear Salam
>
> So you apparently did not read the posting guide as you were supposed to
> when joining this list????
>
> Every email from the list has this footer:
>
> > ______________________________________________
> > R-help at r-project.org 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.
>
> So why didn't you provide commented, minimal, self-contained,
> reproducible code????
>
> Well the man page for augPred has this example:
>
>      fm1 <- lme(Orthodont, random = ~1)
>      augFM1 <- augPred(fm1, length.out = 2, level = c(0,1))
>
> From this you can
>
> plot(augFM1)
>
> Is it something like this you want:
>
> plot(augFM1, par.settings = list(par.main.text = list(cex = 0.5)), main =
> "Testing")
>
> ????
>
> Or this:
>
> plot(augFM1, strip = strip.custom(par.strip.text = list(cex = 0.5)))
>
> ????
>
> If the latter I will leave it as an exercise to you to change the default strip
> height. Google for r lattice strip height
>
> Have a nice day.
>
>
> Yours sincerely / Med venlig hilsen
>
>
> Frede Aakmann Tøgersen
> Specialist, M.Sc., Ph.D.
> Plant Performance & Modeling
>
> Technology & Service Solutions
> T +45 9730 5135
> M +45 2547 6050
> frtog at vestas.com
> http://www.vestas.com
>
> Company reg. name: Vestas Wind Systems A/S
> This e-mail is subject to our e-mail disclaimer statement.
> Please refer to www.vestas.com/legal/notice
> If you have received this e-mail in error please contact the sender.
>
>
> > -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org]
> > On Behalf Of Mir Salam
> > Sent: 15. maj 2014 13:22
> > To: R-help at r-project.org
> > Subject: [R] needs help in augented plot
> >
> > Dear all,
> >
> > I have problem in augmented plot to reduce the text (font ) size in heading
> > of each plot. I have 68 plots and in augmented plot, I have heading of 68
> plots
> > in a panel. The headline of each plot  coded with plot characteristic, but the
> > text seems to be big. How I will reduce the text size?
> >
> > R code
> >
> > plot(augPred(fm3cham.nlme),cex=0.5))
> >
> >
> > Best regards
> > Salam
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org 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.



More information about the R-help mailing list