SDMtune version 0.2.0 the new
SWD() object bundles together presence and absence/background data. This choice is necessary in order to enable new methods that use presence/absence data and to use spatial cross validation. We tried to reduce to the minimum the change in code that the users have to apply and make the transition to the new version as smooth as possible.
The user has two possibilities:
Here we explain how to convert the objects into the new format. If you get an error like:
#> This object was created using SDMtune v <= 0.1.1 and is now deprecated. #> Check the article "Deprecated objects" in the package website to see how to convert this object into the new format.
you are in the right place.
SWD() object allows to store together the presence and the absence/background locations and has a new slot
@pa that contains a vector with ones for presence and zeros for absence/background locations. There are two possible scenarios:
SWD()object to train a model;
SWD()object used as test datasets for presence-only methods.
For the following code we assume that you have two old
SWD() objects, one called presence_swd and the other absence_swd:
It is important that the first argument is the one with the presence locations and the second is the one with the absence/background locations.
The main change in the new
SDMmodel() object is that there is only one slot called
@data that stores the new
SWD() object, instead of the two slots
@a. For the following code we assume that you have an old
SDMmodel() called my_model:
Same for the
SDMmodelCV, the main change is that the slot
@models now contains a list of models that have the new