I am plotting a multiple line graph with ggplot2
and am having trouble labeling the y-axis with mile per second squared. I have tried the command:
ggplot(data.frame, aes(id)) + labs(y = "Acceleration in m/s^2")
and( after searching Stack Overflow):
ggplot(data.frame, aes(id)) + labs(y = expression ("Acceleration in m/s[2]")
In both cases, the label does not create superscript, instead looking exactly like "Acceleration m/s^2". How should this superscript command for a ggplot label be constructed?
Try this instead:
+ labs(y = expression ("Acceleration in"~m/s^2))