Closed fdalby closed 2 months ago
Imports:
(or Depends:
)2a. Call each function with :: e.g. deSolve::lsoda()
or
2b. Include package in import()
in NAMESPACE, and then we can call each function without the packagename::
prefix.
2a is supposed to be safer.
Do we really need dplyr? I have come to dislike the tidyverse packages and tibbles (perhaps not a good reason), and dplyr has a lot of dependencies (see Imports:
here: https://cran.r-project.org/web/packages/dplyr/index.html) which means if there is a problem in any one of those packages or one of their dependencies, there is suddenly a problem with ABM. tidyverse functions do seem less stable than others to me (one reason I stopped using it). See this summary for concerns about too many dependencies: https://www.tinyverse.org/.
I'll see if I can find the relevant code. Alternatives are to use a little more code with base R or perhaps data.table, which has its own significant advantages, along with some disadvantages in my opinion (at least some changes to indexing syntax).
From discussion today, issue is speed, with rbind()
being too slow.
I will look into alternatives, first considering base R options (if we can find something fast), then maybe data.table.
Seems like some dplyr function may be used somewhere in the function definitions somewhere from the warning from R CMD check ...
* checking dependencies in R code ... WARNING
'::' or ':::' import not declared from: ‘dplyr’
Yes. That is bind_rows which is much fast than rbind I found. It is in abm_variable and abm_regular
Ah, OK. From comment just above it looks like I promised to look into alternatives only about 5 months ago! Will check it out, but it seems we need to import something then. I like the difference in the imports lines for data.table versus dplyr:
https://cran.r-project.org/web/packages/dplyr/index.html https://cran.r-project.org/web/packages/data.table/index.html
data.table solution didn't work as easily as I had expected. Might check it out later, but as of 235abeae3930b8c63d2cab0e115385b60deeae3f or so, there is Import: dplyr in DESCRIPTION. Is that the correct statement when we only use one function? I always lose track of these details.
packages loaded. Works fine and I am closing
We need both deSolve and dplyr to be loaded when we load the ABM package. How can this be done automatically?