[R] Superscript followed by number then superscript in text

Rui Barradas ruipbarradas at sapo.pt
Mon Mar 18 22:00:52 CET 2013


Hello,

Something like this?

plot(1, type = "n")
text(1,1, expression(capacity ~ 10^3 ~ m^3))


Hope this helps,

Rui Barradas

Em 18-03-2013 20:29, Benjamin Gillespie escreveu:
> Hi all,
>
> I'm having problems finding the correct format for a command.
>
> I would like to write some text on a plot.
>
> I'm using the following command:
>
> text(x,y,"text here", srt=90)
>
> I would like the text to read:
>
> capacity 10^3 m^3
>
> (with ^ denoting superscript (i.e. each '3' as superscript).
>
> I've tried fiddling around with expression(paste(etc.... to no avail. I receive errors such as: "Error: unexpected numeric constant..."
>
> Anyone had experience with this before? Any suggestions would be great.
>
> Many thanks in advance,
> 		
> Ben Gillespie
> Research Postgraduate
>
> School of Geography
> University of Leeds
> Leeds
> LS2 9JT
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list