
Predicts suitability for xy coordinates according to a trained MaxEnt model WITHOUT cross-validation ('Maxent' object)
Source:R/predict_xy_suitability.R
predict_xy_suitability.Rd
This function predicts establishment suitability for SLF based on a trained MaxEnt model for a set of xy coordinates. The default method is simple point-wise predictions, but predictions can also be made using a buffer zone around each xy coordinate by setting buffer.pred = TRUE.
Usage
predict_xy_suitability(
xy.obj,
xy.type,
env.covar.obj,
model.obj,
mypath,
predict.type = "cloglog",
clamp.pred = TRUE,
buffer.pred = FALSE,
buffer.fun = c("min", "mean", "max"),
buffer.dist = 20000,
output.name
)
Arguments
- xy.obj
Should be a .csv file or data frame that contains xy coordinate data only. Coordinates should be in decimal degree format. Longitude should be listed first, followed by latitude. If a .csv file, file path should be in the format produced by the
file.path()
function (i.e. with '/' instead of '\').- xy.type
Character. Description of the xy data. If species occurrence data, list the name of the species. If another type of coordinate data, list that name. If providing more than one data type or species, separate into different data frames before adding to this function
- env.covar.obj
A stack of rasters of environmental covariates. These covariates may be the same covariates used to train the model, or they may be temporally or spatially projected (ex, for climate change). Suitability predictions will be made based on these rasters. See details for additional formatting information.
- model.obj
A model object created by the package
SDMtune
.- mypath
Character.A file path to the sub directory where the model output will be stored. Should be used with the
file.path()
function (i.e. with '/' instead of '\'). If this sub directory does not already exist and should be created by the function, setcreate.dir = TRUE
. This will create a folder from the last part of the filepath inmypath
.- predict.type
Character. The type of raster output to be created from the trained model. Can be one of
raw
,logistic
orcloglog
. If multiple are desired, must be in the concatenated form:c("cloglog", "logistic")
- clamp.pred
Logical. Should clamping be performed?
- buffer.pred
Logical. Should suitability predictions be made based on a calculation from a buffer around the xy coordinate data? (For Example, take the mean, max, etc value of a 20m buffer around the xy coordinates).
- buffer.fun
Character. The possible functions that can be used to calculate the suitability value for the buffer around a point. Possible values include: "min", "mean", "max", "sum", "isNA", and "notNA".
- buffer.dist
Numeric. The distance from each xy coordinate at which to calculate the suitability value.
- output.name
The name of the file output. Separate words with _. Relevant information might include the name of the model used to predict, the spatial scale, the temporal scale, and the type of data points that are being used for predictions.
Value
This function returns 3+ .csv files.
xy_with_data
: contains the input xy coordinates with the value of each given environmental covariate at that location.xy_no_data
: contains the contains any coordinates that could not be predicted because of an NA value for one or more covariates at that location.xy_pred_suit
: This is the main result file, which contains each coordinate, the type of record and the predicted suitability value. One result file will be returned per predict.type, predict.fun and buffer.fun combination.