Closed tarensanders closed 1 year ago
Thanks for posting the issue and providing a (probably the) solution!
This is a known issue (related to #529), because this also happens for user-defined imputation functions, we are working for a slightly more generic solution (probably this in combination with a globals
argument in future_map()
), but some verification and checks need to be done still.
Ah you're right that just passing in packages wouldn't help for user-defined functions. Let me know if there's a way you'd like me to contribute.
Closing because of #550
If you are trying to use mice with a method provided by an add-on package (e.g., "2l.pmm" from the
{miceadds}
package), the methods don't seem to be available in parallel. That is, they aren't passed into future_map, and so aren't available on the workers.Here's an example (modified from the miceadds docs.
Created on 2023-03-30 with reprex v2.0.2
As you can see, imp1 is fine, but imp2 using futuremice can't find the method.
The solution would seem to be to just pass in additional packages here: https://github.com/amices/mice/blob/3e3e3ca0fa53f1b90fb7142bedf36375d5282e90/R/futuremice.R#L162
Happy to make a PR with this change.