# load sample models:
data(rotif.mods)
# choose a particular model to play with:
mod <- rotif.mods$models[[1]]
logLike(model = mod)
# you can also use logLike with vectors of observed and predicted values
# instead of with a model object:
obs <- mod$y
pred <- mod$fitted.values
logLike(obs = obs, pred = pred)
# 'obs' can also be a table of presence point coordinates
# and 'pred' a SpatRaster of predicted values
Run the code above in your browser using DataLab