Re: [R] inserting mathematical symbols in lattice strip

From: <>
Date: Mon, 12 May 2008 16:47:51 +0100

> I have tried without success to find a way including the square root
> in lattice strips as part of my conditioning labels. I have tried
> supplementing by creating a list of vectors using the 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",
> 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. i.e. converting Bray-Curtis to ... [sqrt symbol]
> Bray-Curtis.

You want factor.level, not in strip.custom.

Here's an example with the iris data. Apologies for the second line; there's almost certainly an easier way to do it, but you (hopefully) get the idea.

flevels <- levels(iris$Species)
foo <- paste("c(", paste("expression(paste(", flevels, ", sqrt(", 1:3, ")))", sep="", collapse=","), ")")
xyplot(Sepal.Length ~ Petal.Length | Species,

    data = iris,


Mathematical Sciences Unit

ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 12 May 2008 - 16:22:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 16:30:38 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive