0

I am working through Hadley Wickham's book "ggplot2" and find that some of his code does not work for me.If I run:

`qplot(carat, price, data = dsmall, geom = c("smooth","point"))`

I get exactly what I should: smoothed line with standard error shading plus individual points.

If I don't want the shading, I try:

 `qplot(carat, price, data = dsmall, geom = c("smooth","point"),se = FALSE)`

I get:

Error: Unknown parameters: se But the parameter se miraculously becomes known if I drop the idea of "point":

`qplot(carat, price, data = dsmall, geom = c("smooth"),se = FALSE)`

yields a smoothed line without shading, just as it should.

What do I need to do to get points and smoothed line without shading?

I am using ggplot 2.1.0

JeremyC
  • 445
  • 2
  • 14

1 Answers1

0

Here is a solution using ggplot (supposing dsmall = diamonds) :

ggplot(diamonds, aes(x = carat, y = price)) + geom_point() + geom_smooth(se = F)
bVa
  • 3,839
  • 1
  • 13
  • 22
  • Thanks for that but I was really looking for a qplot answer. Maybe the answer is just : don't use qplot. – JeremyC Apr 12 '16 at 15:34
  • [more complex plot requires ggplot()](http://stackoverflow.com/questions/5322836/choosing-between-qplot-and-ggplot-in-ggplot2) – bVa Apr 12 '16 at 15:42