[R] How to get a degree sign into a lattice factor level?
Sonam Lodro
kagyukid at yahoo.com
Tue Nov 12 22:12:27 CET 2002
--- Deepayan Sarkar <deepayan at stat.wisc.edu> wrote:
> On Monday 11 November 2002 07:04 pm, Sonam Lodro wrote:
>
> > I notice that expressions can be used in legends, but as far as I can
> > tell, cannot be used as levels for factors. I'd like to be able to do
> > something like that so that the levels printed in a lattice plot show
> > the degree character.
>
> Try something like
>
> xyplot(rnorm(100) ~ rnorm(100) | gl(2, 50),
> strip = function(factor.levels, ...) {
> strip.default(factor.levels = expression(1 * degree, 2 * degree),
> ...)
> })
Thanks for that answer. Martin's answer which was not so directly related
to my question, nevertheless was even more useful. The expression approach
is more difficult to make generic for varying length of factor levels. For
people who don't use Emacs, it's a good approach.
best
__________________________________________________
U2 on LAUNCH - Exclusive greatest hits videos
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list