[R] plot.mob() fails with cut() error "'breaks' are not unique"
Achim.Zeileis at uibk.ac.at
Wed Jan 23 09:06:18 CET 2013
On Tue, 22 Jan 2013, Jason Musil wrote:
> DeaR all,
> I am using mob() for model based partitioning, with a dichotomous
> variable (participant's correct/incorrect response to a test item)
> regressed onto a continuous predictor related to a given property of the
> test item. Although this variable is continuous, the value of this
> variable for many items in this particular analysis is 0. The
> partitioning criterion is self-reported ability in a related area.
>> mob1 <- mob(
> correct ~ circular.mean | srp.dimension,
> Error in cut.default(x, breaks = breaks, include.lowest = TRUE) :
> 'breaks' are not unique
> The same persists if I specify either a desired number of breaks, or
> explicit breakpoints (e.g. breaks=3 or breaks=c(-0.1,0.1,0.5)). I guess
> this is to do with the funny distribution of the predictor variable, but
> I'm not sure what to do about it.
Jason, you can't pass the "breaks" argument to the plot method directly
but need to pass it on to the panel function drawing the terminal panels.
As an example consider
plot(fmPID, tp_args = list(breaks = c(0, 100, 120, 200)))
Hope that fixes your problem.
> Many thanks and apologies if this doesn't fit the mailing list---it is my first posting!
> Jason Musil
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help