Skip to content
Prev 3115 / 63421 Next

a +1 shift overlaying lines/points on a boxplot (PR#398)

acuster@nature.berkeley.edu writes:
...
.....
Boxplot expects a *factor* as the grouping criterion. The x axis
labels are the group names, not x coordinates (i.e. it might as well
be "married, unmarried, divorced" as "0, 1, 2."), and since factors
are internally coded as 1:nlevels, that's the value used for the
actual coordinate system.

Passing a numeric vector gets it converted to a factor before use, so
things are as you should expect. Except possibly for two issues:

a) should one really do the numeric->factor conversion without a
warning message?

b) perhaps boxplot could use an at= argument saying "plot boxes here"
since the current version wouldn't be able to deal with
non-equidistant groups.