I know it's been a while, but we have officially released the latest SpaDES version to CRAN. This version sees several major updates. Please see the release notes below.
version 2.0.0
=============
## Dependency changes
* `SpaDES` package split into several (#198):
* minimum R version increased from `3.2.2` to `3.3.3` as required by several dependencies.
* added `bit`, `fastmatch`, `fastdigest` and `Rcpp` packages to Imports.
* removed `stringr` package from Imports.
## Defunct
* `getFileName`. Wasn't used.
* `p`. Use `params` or `P` instead.
* `versionWarning`. Wasn't used.
## New vignette
* `iii-cache` which shows many of the ways to use `Cache` and build it into a larger reproducible workflow.
## New functionality
* namespaced module functions have now been implemented via a nested environment in the `simList@.envir` slot. This means that module functions can be called by their name only, *without* a `sim$` prefix. Also, there should not be any name clashes between modules, so each module can have its own `init` function, say. This has been implemented in a backwards compatible way, but the old way may be deprecated down the road.
* new functions `saveSimList` which saves all environments recursively and file-backed objects, such as `Raster` objets (currently only one implemented).
* Created a generic for `Copy`, moved it to `reproducible`, and here added a method for `simList` objects that deep copies all environments recursively.
* change default value for `speedup` in `gaussMap`; now 1.
* new function `getPaths()` to return the list of working dirs from the options
* new function `setPaths()` as wrapper for setting the options for working dirs; uses `~/SpaDES` as default base path
* `downloadModule` checks for and uses environment variable `GITHUB_PAT` if it exists (alleviates 403 download errors caused by GitHub download limits)
* `spread2`: new function that is more robust than spread, slightly slower under some situations, but faster in many others. The function is designed to be used as a building block for more complex spreading, where the user can wrap `spread2` inside a custom function that iteratively calls `spread2`, while optionally changing any of the input arguments.
* adj - has a new argument `returnDT`, which slightly improves speed in cases where the user wants the output to become a `data.table`. This simply prevents a call to `as.matrix` in the `return()`, which was occurring if the return value was a `data.table`.
* new function `copyModule` for creating a copy of an existing module
## Performance
* add C++ internal functions for speed
* event queues (event, completed, current) now do shallow copies of pre-existing data.tables, rather than `rblindlist( )`. This improved DES speed by > 40%. Benchmarking of 1400 events in 1.6 seconds now; previously 3.0 seconds.
* add `Copy` (capital C) as replacement for `copy` which conflicts with `data.table::copy`, and add `queues` argument to do a deep copy of the event queues.
* `spread`: minor speedups, plus 3 new parameters `relativeSpreadProb`, `numNeighs` & `exactSizes`
* `distanceFromEachPoint`: uses faster Rcpp code for some use cases & can now take arbitrary columns in either `from` or `to` arguments
* use `%fin%` as faster replacement for `%in%`
## Bug fixes
* workaround issues with RStudio graphics on Linux (with #116): use `dev.noRSGD()` to bypass the Rstudio graphics device for your current session (sets the `device` option for your platform).
* `checksums(..., write = TRUE)` ignores the contents of `CHECKSUMS.txt`, overwriting that file with the checksums of all files in the module's `data/` directory. This makes it easier to update the checksum file, *e.g.*, when adding new data (#332).
* improved module versioning (#321)
* minor bugfixes for unusual cases
* some broken examples were fixed
## Other updates
* improved documentation
* modules are now run with their required packages (`reqdPkgs` in metadata) temporarily bumped to the top of the search path (*i.e.*, `search()`) during each event. `search` path is restored `on.exit` from `spades` or `simInit` call
* change order of parsing of modules: `defineModule` is last, so can use objects defined within module for parameters
* improved `simInit` debug mechanism -- passing character string of module name will enter into a `browser` call inside `doEvent`
* improvements to caching --> these are moved to `reproducible` package:
- improved caching for `Raster*` objects & S4 methods - now it normally persists across sessions;
- add `Cache` (upper case) which derives `cacheRepo` arg automatically from either the `cachePath(sim)`, if used within a module, or `getPath()$cachePath` if not within a module. Also, the upper case removes the name conflict with `archivist::cache`;
- uses `fastdigest::fastdigest` for RAM objects and `digest::digest` for disk-backed objects;
- add caching mechanisms at the module-level and event-level (via new `.useCache` parameter, which can be logical indicating whole module or character indicating individual events);
- add caching for `.inputObjects` function in `simInit`, via `.useCache` parameter in module
- detailed caching overview now in cache help: `?Cache` for details.
- strips dirname for outputs and inputs, *i.e.*, only keeps the filename, not absolute paths. This may not be stringent enough in some cases.
- New cache-related function: `keepCache`
* implemented `checkModuleLocal()` to check for presence of module files in the module dir before attempting download from remote module repository
* improve module template to auto fill module author info using `devtools.desc.author` option if set.
* `zipModule` now has `data` argument, allowing data to be omitted from zipped module.
* improved `moduleDiagram` to show `_INPUT_` node in different colour from the other modules