Really struggling to get the code right for a ggplot
y-axis label.
Please can someone help me out before I break the computor...
This is the code for my graph:
ggplot(urea, aes(x = Time, y = Flux_N2O, fill = Chamber, colour = Chamber)) +
geom_point() + geom_line() + scale_y_continuous(limits = c(0,300)) +
scale_x_datetime(date_breaks= "7 days", date_minor_breaks = "1 day") +
xlab("n/Date") + ylab(expression(N[2]O-N~Flux~(mug~m^{-2}~h^{-1})))
I want it to look like this N2O Flux ug m-2 h-1 where the "2" in "N2O" is sub-scripted and all the other numbers are super-scripted an mu in the Greek for micro.
I have looked at other similar questions on SO but can't figyre out what I'm doing wrong. I am getting the following error:
Error: unexpected symbol in:
" scale_x_datetime(date_breaks= "7 days", date_minor_breaks = "1 day") +
xlab("n/Date") + ylab(expression(N[2]O"