Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with map function #45

Closed
gittemc opened this issue Aug 17, 2023 · 1 comment
Closed

error with map function #45

gittemc opened this issue Aug 17, 2023 · 1 comment

Comments

@gittemc
Copy link

gittemc commented Aug 17, 2023

I have been using aniMotum this last week and after fitting a model I was making maps with the map function. Everything was working earlier in the week, but for the last few days, using the exact same code/script and keep getting the error:
Error in map(fit.rw, what = "predicted") :
argument ".f" is missing, with no default

I have tried to restart R and my computer multiple times. I have checked my code from everything I can find the code is correct.
Below is an example of the code - everything seems to work but the map function. I am sure I am doing something silly, but have not been able to figure out what has changed.
fit.crw <- fit_ssm(data_c,
model = "crw",
time.step = 3,
vmax=4,
control = ssm_control(se = TRUE))

plot(fit.crw, what = "fitted")
plot(fit.crw, what = "predicted")
plot(fit.crw, "p", type = 2, alpha = 0.1)

require(patchwork)
res.crw <- osar(fit.crw)
(plot(res.crw, type = "ts") | plot(res.crw, type = "qq")) /
(plot(res.crw, type = "acf") | plot_spacer())

map(fit.crw, what = "predicted")
map(fit.crw, what = "fitted")

@ianjonsen
Copy link
Owner

You've got a conflict between purrr and aniMotum - both pkgs have a map function. To resolve, you can either make sure you load purrr (or tidyverse) first and then aniMotum, or, more preferably, update the last 2 lines of your script with:

aniMotum::map(fit.crw, what = "predicted")
aniMotum::map(fit.crw, what = "fitted")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants