Skip to content
Prev 326464 / 398502 Next

Transferring commas in character vector to expression

Hi Eric

I have not been following the thread but following on what David has 
said on previous occasions

try for example

plot(1,1, ylab =  expression("aa aaa,aa bb"*Delta*"b cccc"*Delta*"cc, c") )

Below is from a partly saved previous post of David's several months 
ago which may give you some ideas

DATA_names<-c(
"A mg kg",
"B mg kg",
"C mg kg",
"D mg kg",
"E mg kg",
"F mg kg",
"G mg kg",
"H mg kg")

pos <- barplot(1:length(DATA_names))
text(x=pos,y=-1, xpd=TRUE, srt=45,
                    labels= sapply( gsub("mg kg", "(mg kg)^-1", DATA_names),
                                    as.expression))

HTH

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au
At 07:47 6/07/2013, you wrote: