0

When i try to plot a binary response variable (Goose field Y or N) against a continuous response variable (field size) using:

plot(formula=main$GOOSE_FIELD~main$M2)

it produces a bar plot instead of a rug plot with data points lined up against Y or N on y axis. How can I produce the rug plot format?

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • Please provide a reproducible example. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Pierre Lapointe Apr 21 '17 at 21:17
  • When asking for help you should include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. What exactly do you mean by "rug" plot. – MrFlick Apr 21 '17 at 21:17
  • 1
    its sometimes more standard to plot the points and add a smoother eg. `plot(am ~ mpg , data=mtcars) ; with(loess(am~mpg, data=mtcars, span=1), lines(fitted[order(x)] ~ x[order(x)]))` – user2957945 Apr 21 '17 at 21:27
  • And possibly add some jitter to the suggestion by @user2957945 to prevent overplotting – ekstroem Apr 21 '17 at 22:46

0 Answers0