HI all I'm using Rstudio with the following dataframe:
X NSUM MEAN LOWMEAN UPMEAN
2 Nonmonetary Incentive 800 4.86 4.58 5.15
3 $0 (no mention) 822 5.06 4.78 5.35
4 $25 830 6.35 6.06 6.65
5 $50 815 6.84 6.54 7.14
6 $75 864 7.00 6.70 7.29
So I've created this nice plot using the following command:
plot1 <- ggplot(rawdata, aes(x = rawdata$X, y = rawdata$MEAN)) +
geom_point(colour = "red") +
geom_errorbar(aes(ymin = rawdata$LOWMEAN, ymax = rawdata$UPMEAN, width =0), colour = "black") +
coord_flip()
Which plots the means and a bar to show the upper and lower bounds. What I want to do is change the y axis so the ticks don't appear as often but no matter what I do, ylim() or scale_y_continuous() I get the error:
Discrete values applied to continuous variable?
$
inside ggplot. In the first argument you specifyrawdata
as your data, you don't have to keep re-typing it throughout. – Gregor Thomas