[R] aplpack / bagplot
er|cjberger @end|ng |rom gm@||@com
Wed Sep 21 12:09:22 CEST 2022
I have never used the aplpack package but out of curiosity I tried it out.
Doing a scatter plot of your (x,y) data shows that there are many repeated
x values, and this seems to be the source of the error.
There are no repeated y values. It seems that the bagplot() function does
not handle repeated x-values.
I tried adding some noise to the x-values and that worked fine.
x2 <- x + rnorm(length(x),0,1.e-5)
On Wed, Sep 21, 2022 at 12:54 PM Sigbert Klinke <sigbert using wiwi.hu-berlin.de>
> I get an error when I use bagplot from the package aplpack. Any ideas
> what theproblem is with the data set?
> x <- c(5, 2, 1, 6, 3, 5, 4, 7, 4, 4, 3, 4, 5, 4, 6, 3, 3)
> y <- c(2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 1, 14, 17, 18, 19, 20, 22)
> bagplot(y,x) # works
> bagplot(x,y) # Error in pg[segm.no, 2] : (subscript) boolean index too
> Thanks Sigbert
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help