yarrr
yarrr copied to clipboard
pirateplot does not handle sub IVs with different number of levels correctly
Example: dat=data.frame(IV1=rep(c(1,2,1,2,3),each=3),IV2=rep(c(1,1,2,2,2),each=3),DV=runif(5*3)) pirateplot(DV~IV1+IV2,dat)
This also leads to an error if inf.method="ci". pirateplot(DV~IV1+IV2,dat,inf.method="ci")
Thanks for catching this. I believe I have fixed it. Please install version 0.1.5 from github with devtools::install_github("ndphillips/yarrr")
and let me know if it works correctly.
I think I'm having the same issue but with a third IV. I installed the newest version from github and it is still and issue. Only the levels that all three IVs share (ie., only levels 1 and 2 of IV2 and not levels 3 and 4) are plotted. This wasn't an issue with earlier versions of pirateplot()
.
dat=data.frame(IV1=rep(c(1,2,1,2,1,1,2,1,2,1,2,1,1,2),each=3),IV2=rep(c(1,2,1,2,3,4,1,2,3,3,1,2,2,2),each=3),IV3=rep(c(1,1,2,2,2,2,3,3,3,3,3,3,3,3),each=3),DV=runif(14*3)) pirateplot(DV~IV1+IV2+IV3,dat,inf.method="hdi",theme=2,avg.line.fun = median)