[R] Adding a superscript 6 to a number
bgunter@4567 @end|ng |rom gm@||@com
Tue Dec 29 17:07:28 CET 2020
Does this do what you want?
x <- .25
text(.5,.5, labels = bquote(.(x)^6, list(x= x)))
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Dec 29, 2020 at 7:50 AM Sorkin, John <jsorkin using som.umaryland.edu>
> I would like to create a number (stored in the variable x) to the number
> with the exponent of, i.e. the number to the sixth power. The code I have
> tried, pasted below does not work.
> # create plot
> # Create a string containing the base and exponent.
> x <- 0.95123
> # Convert the base to text and add the exponent of 6
> mylab <- expression(paste(" ",character(x)^6))
> # Add the text to the plot
> I hope someone can show me how to create the text string I need.
> Thank you,
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help