Closed niming2 closed 2 years ago
I hit the same issue! Would love to know if there are any fixes
Changing class(Y) != "matrix") to inherits(Y, "matrix") == FALSE in the source code might do the trick? class(Y) also returns "array", along with "matrix"
I spend a while trying to figure out how to do this but I'm not so adept at coding. I can't find a line about class(Y) in estimate_shift_configuration. Maybe it's in a different function but I'm not sure how to find it. Any other pointers would be much appreciated...
I think lines 128-30 cause this error:
if( class(Y) != "matrix"){ Y <- as.matrix(Y) }
Changing to
if (inherits(Y, "matrix") == FALSE) { Y <- as.matrix(Y) }
works
Ok, I will try again!
Thank you Lars for the fix! I made a pull request #51 with this change. It looks like it may fix issue #46 also.
Hi Cecile, It seems like this helped some but there are still errors I don't understand. To test the fixes, I reinstalled l1ou, then copied the versions of tools.R and estimate_shift_configuration.R with your fixes, and tried the example dataset from the manual. For this, I get:
eModel<-estimate_shift_configuration(lizard$tree, lizard$Y) Error in erase_configuration_score_db() : could not find function "erase_configuration_score_db"
Interestingly when I try my own dataset, it starts but then I get a different error:
shapePC1_pBIC <- estimate_shift_configuration(pet_ready$tree, pet_ready$Y, root.model="OUrandomRoot", criterion="pBIC", nCores=4, quietly = TRUE) Starting first LASSO (alpha=0) to find a list of candidate configurations. Starting second LASSO (alpha= 0.9 ) for another list of candidates. Error in get_stored_config_score() : could not find function "get_stored_config_score"
Maybe it's just that I can't just swap out the changed functions by sourcing the new versions?
Thanks! Stacey
I really don't know where the new errors come from. Perhaps you could try to install l1ou via my fork?
install_github("cecileane/l1ou")
Ok, yes that worked, at least with the example. Yay!! I will have to try with my own data later tonight. Thank you!!
I have a error when running estimate_shift_configuration (): Error in if (class(Y) != "matrix") { : the condition has length > 1 Even with the function example eModel <- estimate_shift_configuration(lizard$tree, lizard$Y) . Possibly because I'm in new R version 4.2.0?