0

I have a problem with sjPlot command: sjt.grpmean

This is my example:

x <- rnorm(120,1230,220)
f <- c(rep("men",60),rep("women",60))
d <- data.frame(x,f)

library(sjPlot)

sjt.grpmean(var.cnt = d$x,
            var.grp = d$f)

The result is just weird.

I try this:

x <- rnorm(120,1230,220)
f <- as.factor(c(rep("men",60),rep("women",60)))
d <- data.frame(x,f)

library(sjPlot)
sjt.grpmean(var.cnt = d$x,d$f)

With same weird result.

I Can use this workaround:

sjt.grpmean(var.cnt = d$x,
            var.grp = d$f,
            value.labels = c("men","women"))

But, why i need to use value.labels to fix? is this a bug?

I will appreciate any help.

R version 3.3.2 (2016-10-31)

sjPlot 2.3.0

Victor Espinoza
  • 318
  • 1
  • 9

1 Answers1

0

is this a bug?

Yes, it's a bug you found. I have already fixed it in the current dev-version on GitHub, a CRAN-update may follow in March...

Daniel
  • 7,252
  • 6
  • 26
  • 38
  • Thanks, i can't install the dev-version in my personal pc (i use it a lot for my job and using dev version create me problem with another package), but i will try the github in another pc. – Victor Espinoza Feb 23 '17 at 19:46
  • Yes, the dev-version depends on my other packages. So, you first need to install sjmisc, than sjstats and finally sjPlot from GitHub. That should work. – Daniel Feb 24 '17 at 15:09