yuryzablotski / yuzaR

0 stars 0 forks source link

Problem of running glmulti #1

Open realsmak88 opened 2 years ago

realsmak88 commented 2 years ago

Hi Yuri, I find very interesting and useful your work ! Congrats for that, but I was trying to run your whole code and I encountered some issues here :

glmer.glmulti<-function(formula, data, random = "", ...){ glmer(paste(deparse(formula),random), data = data, REML = F, ...) }

mixed_model <- glmulti( y = response ~ predictor_1 + predictor_2 + predictor_3, random = "+(1|random_effect)", crit = aicc, data = data, family = binomial, method = "h", fitfunc = glmer.glmulti, marginality = F, level = 2 )

... And the message was :

Error in as.data.frame.default(data, optional = TRUE) : cannot coerce class ‘"function"’ to a data.frame

So ... I don't know why it is like this but the rest of the script run perfectly.

Thanks in advance

yuryzablotski commented 2 years ago

Hi, there is no "data" to run this code, no response, no predictor_1 etc. . This is just a theoretical example of how to write a wrapper function. I am glad that the rest runs. Thanks for the feedback and cheers