[R] How to superscript

arun smartpink111 at yahoo.com
Fri Feb 14 18:20:47 CET 2014


Hi,
Try:
x <- 1985:1990
set.seed(45)
y <- sample(70:90,length(x),replace=TRUE)
plot(x,y,xlab="Year",ylab=expression(Temperature~degree*C),main="April Average Temperature 1985-1990",type="p")

A.K.

I want to provide a label for my x,y plot as such: ylab="Temperature 
(^oC)", where the o is meant to be superscripted. This isn't working. 
I've googled it and looked at the user manual but I can't figure it out.
 Can anyone explain the mechanism for superscripting something please? 

I've tried: plot(x,y, xlab(expression(Year)), 
ylab(expression(Temperature(~{o}~C))", main(expression(April Average 
Temperature 1961-2010)), type="p"), 
and I've tried some other things that I can't remember all of now. 
Very confused. It should be a simple thing to superscript something in a
 heading!



More information about the R-help mailing list