gamlj error when reproducing in Rstudio

Discuss the jamovi platform, possible improvements, etc.

by rjs » Fri Sep 11, 2020 11:58 pm

Hi there, first posting;

I am trying to re-run code generated by the GAMLJ module (in Jamovi) in Rstudio and am getting a consistent error (i.e., using both a GLM and a mixed model approach) while executing exported code:

"Error: Argument 'covs' requires a numeric variable ('some_factor' is not valid)" See mockup of actual code exported below:

formula = `dependent_variable` ~ `some_factor` * `another_factor` * `a_third_factor`,
data = data)

I installed the gamlj package and ran above code. This error seems odd to me as I am using a formula, and according to GAMLJ package descriptions, 'covs' is not required when using a formula?

Any idea what this error may be referring to? Adding "covs=NULL" for example doesn't help.

Thanks for any insight, RJS
Posts: 3
Joined: Sun Sep 06, 2020 1:37 am

by jonathon » Sat Sep 12, 2020 12:22 am


i think we'll need a reproducible example to understand what's going on here.

i've just done a quick test on the ToothGrowth data set, and it works:

gamlj::gamljGLM(ToothGrowth, formula=len~dose*supp)

so there's something unexpected about your data.


User avatar
Posts: 1474
Joined: Fri Jan 27, 2017 10:04 am

by rjs » Sat Sep 12, 2020 1:12 am

Gotcha. I will have a look and get back to you.
Posts: 3
Joined: Sun Sep 06, 2020 1:37 am

by rjs » Sat Sep 12, 2020 2:30 am

Ok I figured this out. Rstudio did not recognize my "some_factor" for a factor properly. Once I told her it was a factor indeed, all worked well. I suppose gamljGLM() does the checking in the background. Thanks!
Posts: 3
Joined: Sun Sep 06, 2020 1:37 am

Return to General