Re: [R] mathematical expression in varnames of lattice parallel plot

2010-06-30 Thread Deepayan Sarkar
On Mon, Jun 28, 2010 at 6:32 PM, Doris Brockmann
brock...@supagro.inra.fr wrote:
 How can I insert mathematical expressions for variable names in a lattice
 parallel plot? I tried to implement mathematical expressions in varnames,
 however, without success.

 For example, neither

 parallel(~iris[1:4] | Species, iris,

        varnames=c(P[Width], Petal[length], alpha[Width],
 Sepal[Length]))

 nor

 parallel(~iris[1:4] | Species, iris,
        varnames=c(expression(P[Width]), expression(Petal[length]),
 expression(alpha[Width]),
                        expression(Sepal[Length])))

 result in the desired labeling of the different axes of the parallel plot.

Your example will not work in the released version of lattice, but it
does work in the development version (available from
https://r-forge.r-project.org/R/?group_id=638).

BTW, you could shorten it to:

parallel(~iris[1:4] | Species, iris, varnames=expression(P[Width],
Petal[length], alpha[Width], Sepal[length]))

A workaround for the released version is:

parallel(~iris[1:4] | Species, iris, scales = list(y = list(at = 1:4,
labels = expression(P[Width], Petal[length], alpha[Width],
Sepal[length]

-Deepayan

__
R-help@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.


[R] mathematical expression in varnames of lattice parallel plot

2010-06-28 Thread Doris Brockmann
How can I insert mathematical expressions for variable names in a 
lattice parallel plot? I tried to implement mathematical expressions in 
varnames, however, without success.


For example, neither

parallel(~iris[1:4] | Species, iris,

varnames=c(P[Width], Petal[length], alpha[Width], 
Sepal[Length]))

nor

parallel(~iris[1:4] | Species, iris,
varnames=c(expression(P[Width]), expression(Petal[length]), 
expression(alpha[Width]),
expression(Sepal[Length])))

result in the desired labeling of the different axes of the parallel plot.

Thank you very much.

Regards,

Doris

--
---
Dr.-Ing. Doris Brockmann
Post-doctoral researcher
INRA - Laboratoire de Biotechnologie de l'Environnement (LBE)
Avenue des Etangs,
Narbonne, F-11100, France
Tel : (33)(0)4 68 42 51 88 (standard : 51 51)
Fax : (33)(0)4 68 42 51 60
email: brock...@supagro.inra.fr
http://www.montpellier.inra.fr/narbonne

__
R-help@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.