I am trying to run the below code:
lcga1 <- lcmm::hlme(NFL_log ~ Days_since_injury, random = ~1, ng = 1, subject ='subjectId_new', data = biom)
lcga2 <- lcmm::gridsearch(rep = 100, maxiter = 10, minit = lcga1, m=lcmm::hlme(NFL_log ~ Days_since_injury, subject ='subjectId_new', ng = 2, data = biom, mixture =~ Days_since_injury))
lcag1 runs fine.
When I run lcga2 I get this error:
Error in do.call(as.character(mc[[1]]), as.list(mc[-1]), envir = parent.frame()) : 'what' must be a function or character string
I can not work out what I am doing wrong to get this. Any help is appreciated. Apologies if there is not enough information - this is my first post to stack overflow.
Thank you for any help.
I have tried reinstalling R and R studio. I have also updated all packages.