Dear R-users, I would like to know how to pass arguments to gpar() without hard-coding them. I tried to store my arguments in a list and passed this list to gpar(), but it did find the way to do it properly. Any help would be appreciated. a<- list(fontisze=8,col=3) gpar(fontsize=8,col=3) gpar(a) gpar(unlist(a))
Hi Sebastien Bihorel wrote:> Dear R-users, > > I would like to know how to pass arguments to gpar() without hard-coding > them. I tried to store my arguments in a list and passed this list to > gpar(), but it did find the way to do it properly. Any help would be > appreciated. > > a<- list(fontisze=8,col=3) > gpar(fontsize=8,col=3) > gpar(a) > gpar(unlist(a))Are you looking for this ... ? do.call("gpar", a) Paul> ______________________________________________ > 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.-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Hi, Yes, that is exactly it. Charlie Sharpsteen gave me the same solution last week but he probably just replied to me, so his email did not go to the list. Thanks for the reply, I appreciate it.... I always forget about this do.call function. Paul Murrell wrote:> Hi > > > Sebastien Bihorel wrote: >> Dear R-users, >> >> I would like to know how to pass arguments to gpar() without >> hard-coding them. I tried to store my arguments in a list and passed >> this list to gpar(), but it did find the way to do it properly. Any >> help would be appreciated. >> >> a<- list(fontisze=8,col=3) >> gpar(fontsize=8,col=3) >> gpar(a) >> gpar(unlist(a)) > > > Are you looking for this ... ? > > do.call("gpar", a) > > Paul > > >> ______________________________________________ >> 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. >
Apparently Analagous Threads
- Problem with viewports, print.trellis and more/newpage
- Apparent different in symbol scaling between xyplot and grid.points
- Understanding padding in lattice
- What name-value pairs can be used in gpar()?
- adjusting textsize and spacing in mosaic (vcd package)