Closed papayoun closed 1 week ago
Hi @papayoun, thanks for finding the bug. I'll have a look into it (it's probably due to the "non standard" formulas used in ZIPLN).
Can you just check something for me: I get an error when I try to use as.formula()
within ZIPLN within a loop but your reprex suggests it works for you (I have the same error as the one you get with lapply()
or the raw object). Can you confirm this ?
library(PLNmodels)
#> This is package 'PLNmodels' version 1.2.0
#> Use future::plan(multicore/multisession) to speed up PLNPCA/PLNmixture/stability_selection.
# Creating vector of formulas
zi_pln_formulas <- c("Abundance ~ 1 | 1")
# Works fine within a loop using as.formula
for(x in zi_pln_formulas){
ZIPLN(x, data = barents)
} # Works fine for @papayoun
# but not for me
#> Error in x$formula: objet de type 'symbol' non indiçable
Created on 2024-04-10 with reprex v2.1.0
Found a fix (need to eval the symbol in the correct environment to get the right formula). A PR is en route.
Seems to work without any "as.formula" inside/outside the loop.
@papayoun could you please confirm that the current master version of PLNmodels fixes your problem ?
thank you,
Ok, closing since no reaction of @papayoun
I work with version 1.2.0 of the package, downloaded on github, and I have issue to use
ZIPLN
within (mc)lapply framework to parallelize treatment over different model formulas.Basically, what I would like to do with
ZIPLN
is this, which works with the classicalPLN
function:I then define a new formula and I want to use
ZIPLN
, but this won't work within lapply. It works if I do it within a loop:However, the following codes won't work (the error is shown in comment each time)
My
R
session info is the following