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. i.e. converting Bray-Curtis to ... [sqrt symbol] Bray-Curtis. Thank you very much Regards Andrew http://www.nabble.com/file/p17188291/randA1.csv randA1.csv -- View this message in context: http://www.nabble.com/inserting-mathematical-symbols-in-lattice-strip-tp17188291p17188291.html Sent from the R help mailing list archive at Nabble.com.
Richard.Cotton at hsl.gov.uk
2008-May-12 15:47 UTC
[R] inserting mathematical symbols in lattice strip
> I have tried without success to find a way including the square rootsymbol> 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 oram I> wasting my time. i.e. converting Bray-Curtis to ... [sqrt symbol] > Bray-Curtis.You want factor.level, not var.name 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, strip=strip.custom(factor.levels=eval(parse(text=foo)))) Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
Seemingly Similar Threads
- Mathematical annotation in lattice strip: Is it possible?
- y-axis slightly cut-off after printing plots to tiff
- metaMDS Error, Nan similar or negative values
- How to circumvent negative eigenvalues in the capscale function
- Comparing long species lists via Sorensons dissimilarity