I try to generate a label with superscript and therefore using parse. I seem to cannot use whitespaces, this works:
GTVol <- 1:10
measuredVol <- 1:10
dat <- data.frame(GTVol, measuredVol)
ggplot(dat, aes(GTVol, measuredVol)) +
geom_point() +
geom_abline(slope=1) +
xlab(parse(text='HarvestedVolume(m^3)')) +
ylab("QSM Volume (m^3)")
but this is not working:
GTVol <- 1:10
measuredVol <- 1:10
dat <- data.frame(GTVol, measuredVol)
ggplot(dat, aes(GTVol, measuredVol)) +
geom_point() +
geom_abline(slope=1) +
xlab(parse(text='Harvested Volume (m^3)')) +
ylab("QSM Volume (m^3)")
giving me the following error:
Error in parse(text = "Harvested Volume (m^3)") :
<text>:1:11: unexpected symbol
1: Harvested Volume

