Closed XiaoyuZeng closed 4 years ago
Can you please post output from sessioninfo::sessioninfo()
?
Can you please post output from
sessioninfo::sessioninfo()
?
Updated. Sorry.
Hmm, strange. I can't seem to find anything amiss about the package versions. They seem to be the same ones I have on my local machine and I don't get any error for the function where you get the error. In your traceback
, you can see that the function mean_labeller
is where the execution runs into problems.
But it runs just fine, not only on my local machine but also on virtual Travis and AppVeyor machines for both R 3.6
and R 4.0
.
library(ggstatsplot)
#> Registered S3 method overwritten by 'broom.mixed':
#> method from
#> tidy.gamlss broom
#> Registered S3 methods overwritten by 'car':
#> method from
#> influence.merMod lme4
#> cooks.distance.influence.merMod lme4
#> dfbeta.influence.merMod lme4
#> dfbetas.influence.merMod lme4
ggstatsplot:::mean_labeller(data = mtcars, am, wt)
#> # A tibble: 2 x 4
#> am wt label n_label
#> <fct> <dbl> <chr> <chr>
#> 1 0 3.77 list(~italic(widehat(mu))== 3.769 ) "0\n(n = 19)"
#> 2 1 2.41 list(~italic(widehat(mu))== 2.411 ) "1\n(n = 13)"
Created on 2020-03-17 by the reprex package (v0.3.0)
What do you get if you run the following?
ggstatsplot:::mean_labeller(data = mtcars, am, wt)
Hmm, strange. I can't seem to find anything amiss about the package versions. They seem to be the same ones I have on my local machine and I don't get any error for the function where you get the error. In your
traceback
, you can see that the functionmean_labeller
is where the execution runs into problems.But it runs just fine, not only on my local machine but also on virtual Travis and AppVeyor machines for both
R 3.6
andR 4.0
.library(ggstatsplot) #> Registered S3 method overwritten by 'broom.mixed': #> method from #> tidy.gamlss broom #> Registered S3 methods overwritten by 'car': #> method from #> influence.merMod lme4 #> cooks.distance.influence.merMod lme4 #> dfbeta.influence.merMod lme4 #> dfbetas.influence.merMod lme4 ggstatsplot:::mean_labeller(data = mtcars, am, wt) #> # A tibble: 2 x 4 #> am wt label n_label #> <fct> <dbl> <chr> <chr> #> 1 0 3.77 list(~italic(widehat(mu))== 3.769 ) "0\n(n = 19)" #> 2 1 2.41 list(~italic(widehat(mu))== 2.411 ) "1\n(n = 13)"
Created on 2020-03-17 by the reprex package (v0.3.0)
Session info What do you get if you run the following?
ggstatsplot:::mean_labeller(data = mtcars, am, wt)
It runs just fine.
ggstatsplot:::mean_labeller(data = mtcars, am, wt)
#> Registered S3 methods overwritten by 'broom.mixed':
#> method from
#> augment.lme broom
#> augment.merMod broom
#> glance.lme broom
#> glance.merMod broom
#> glance.stanreg broom
#> tidy.brmsfit broom
#> tidy.gamlss broom
#> tidy.lme broom
#> tidy.merMod broom
#> tidy.rjags broom
#> tidy.stanfit broom
#> tidy.stanreg broom
#> Registered S3 methods overwritten by 'car':
#> method from
#> influence.merMod lme4
#> cooks.distance.influence.merMod lme4
#> dfbeta.influence.merMod lme4
#> dfbetas.influence.merMod lme4
#> # A tibble: 2 x 4
#> am wt label n_label
#> <fct> <dbl> <chr> <chr>
#> 1 0 3.77 list(~italic(widehat(mu))== 3.769 ) "0\n(n = 19)"
#> 2 1 2.41 list(~italic(widehat(mu))== 2.411 ) "1\n(n = 13)"
Created on 2020-03-17 by the reprex package (v0.3.0)
So this seems to have something to do with your data and I can't diagnose that without a self-contained reprex
.
Your original reprex
points to data on your local machine:
data <- import("E:/Zengxiaoyu/zxy_projcet/!ncov/data/Covid_Q1Q2data_minus200_0316.xlsx")
Thanks, Indrajeet. Thanks for the feedback. And thank you for guiding me to make the problem clearer.
I made another reprex with minimal data. Error remains.
library("tidyverse")
library("ggstatsplot")
#> Registered S3 methods overwritten by 'broom.mixed':
#> method from
#> augment.lme broom
#> augment.merMod broom
#> glance.lme broom
#> glance.merMod broom
#> glance.stanreg broom
#> tidy.brmsfit broom
#> tidy.gamlss broom
#> tidy.lme broom
#> tidy.merMod broom
#> tidy.rjags broom
#> tidy.stanfit broom
#> tidy.stanreg broom
#> Registered S3 methods overwritten by 'car':
#> method from
#> influence.merMod lme4
#> cooks.distance.influence.merMod lme4
#> dfbeta.influence.merMod lme4
#> dfbetas.influence.merMod lme4
df <- read.table(
header = TRUE,
text = " hubei self other province
1 HuBei 7 10 5
2 HuBei 2 0 0
3 HuBei 0 0 -22
4 HuBei 2 2 9
5 HuBei 11 -1 -4
6 HuBei 0 0 3
"
)
long_df <- tidyr::pivot_longer(df, 2:4, names_to = "variable", values_to = "Emotion_rating")
ggwithinstats(
data = long_df,
x = variable, # > 2 groups
y = Emotion_rating,
point.path = FALSE
)
#> Note: 95% CI for effect size estimate was computed with 100 bootstrap samples.
#>
#> Error: Names must be unique.
Created on 2020-03-18 by the reprex package (v0.3.0)
Thanks a lot! I can reproduce this. This actually seems to trace to groupedstats
package, so I will move the issue there: https://github.com/IndrajeetPatil/groupedstats/issues/24
The problem:
I tried to run a function (ggwithinplot) to plot data in ggstatsplot. But it took a long time to run this function, and nothing turned out:
So I shut down this function while it was running. I tried waiting. It didn't work. So this problem was not a time issue.
After that, I was wondering whether it was due to that I got a large number of data points (N=2000). So I tried another sample that includes 250 data points. And this time, I got this error: "ERROR: Names must be unique."
And I checked traceback:
What I have tried:
(https://stackoverflow.com/questions/60720673/how-to-solve-error-names-must-be-unique-in-r-package-ggstatsplot)
Here comes the reprex:
data frame
session info
Any ideas?