Andrewjohnclose
2008-May-12 13:46 UTC
[R] Mathematical annotation in lattice strip: Is it possible?
I have tried without success to find a way including the square root symbol in lattice strips as part of my conditioning labels. I have tried supplementing by creating a list of vectors using the var.name function coupled with the expression function used in xlab/ylab. xyplot(adjusted_Rand_index~cluster|distance_measure, main="Level of agreement between partitions: Wards Method", ylab="Coefficient value (adjusted rand index)", xlab="number of clusters", type="l", data=randA1, strip=strip.custom(varnames=c(expression(sqrt(Bray-Curtis))) Is there a way of generating the square root symbol inside the strip or am I wasting my time. Thank you very much Regards Andrew http://www.nabble.com/file/p17187888/randA1.csv randA1.csv -- View this message in context: http://www.nabble.com/Mathematical-annotation-in-lattice-strip%3A-Is-it-possible--tp17187888p17187888.html Sent from the R help mailing list archive at Nabble.com.
Deepayan Sarkar
2008-May-12 16:05 UTC
[R] Mathematical annotation in lattice strip: Is it possible?
On 5/12/08, Andrewjohnclose <a.j.close at ncl.ac.uk> wrote:> > I have tried without success to find a way including the square root symbol > in lattice strips as part of my conditioning labels. I have tried > supplementing by creating a list of vectors using the var.name function > coupled with the expression function used in xlab/ylab. > > xyplot(adjusted_Rand_index~cluster|distance_measure, main="Level of > agreement between partitions: Wards Method", ylab="Coefficient value > (adjusted rand index)", xlab="number of clusters", type="l", data=randA1, > strip=strip.custom(varnames=c(expression(sqrt(Bray-Curtis)))You say 'var.names', but use 'varnames'. ?strip.custom also says: var.name: vector of character strings or expressions as long as the number of conditioning variables. The contents are interpreted as names for the conditioning variables. Whether they are shown on the strip depends on the values of 'strip.names' and 'style' (see below). By default, the names are shown for shingles, but not for factors. This seems to work as expected: xyplot(1 ~ 1 | gl(1, 1), strip = strip.custom(var.name = expression(sqrt(Bray-Curtis)), strip.names = TRUE, strip.levels = FALSE)) -Deepayan