mkshaw / r2mlm

r2mlm: R Package for Calculating R-Squared in Multilevel Models
27 stars 1 forks source link

Error in UseMethod("group_by_") : no applicable method for 'group_by_' applied to an object of class "NULL" #43

Closed gwang921921 closed 3 years ago

gwang921921 commented 3 years ago

Hi! Thank you so much for building this package! It looks awesome! But when I copied the example you provided (based on the "teachsat" dataset), I never got the results. Actually, it took R forever to run the code and when I clicked on "stop", I got the following error: Error in UseMethod("groupby") : no applicable method for 'groupby' applied to an object of class "NULL".

I got the same issue running my own model. Any thoughts? Thanks in advance!

mkshaw commented 3 years ago

Hello! 👋 Three follow-up questions:

  1. What code did you run?
  2. How long, specifically, did you leave it running?
  3. What operating system are you working on?
gwang921921 commented 3 years ago

Thank you so much for your reply:)

I ran the following code:

data(teachsat)

model_lme4 <- lmer(satisfaction ~ 1 + salary_c + control_c + salary_m + control_m + s_t_ratio + (1 + salary_c + control_c| schoolID), data = teachsat, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))

r2mlm(model_lme4)

I left it running for a few minutes, and my OS is Windows 10.

mkshaw commented 3 years ago

Thank you so much for your reply:)

No problem! 🙂

I left it running for a few minutes, and my OS is Windows 10.

Got it. I'm not really sure what the problem is, so my current guess is that it's something related to your computer's processing power or memory. It happens to me from time to time: code that otherwise runs properly in RStudio just runs forever. My advice is to try restarting your computer, or if possible try the code on another machine.

gwang921921 commented 3 years ago

Thank you so much! I ran it on another computer and the problem is solved. Thanks again!!

mkshaw commented 3 years ago

Fantastic; glad to hear it!