I have problems to use stripchart()
with the right placement of X- and Y-axes and with the correct direction of the stacked points.
This MWE imitates the steps I do with my real data
# stratify mtcars$mpg_strat
mtcars$mpg_strat <- cut(mtcars$mpg, breaks=seq(0,50,by=5))
stripchart(gear~mpg_strat,
data=mtcars,
method="stack",
offset=.5, pch=20)
- I want to have
gear
in the Y-axis andmpg_strat
(stratifiedmpg
) on the X-axis. - And the points should be stacked from bottom to top (vertical) and not from left to right (horizontal).
The example here doesn't produce it that way. When I try to switch mpg_strat~gear
I get an error
Fehler in Summary.factor(c(5L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 3L, 3L, 5L, :
‘range’ not meaningful for factors