Skip to contents

The write_output function is a generic wrapper to writing any output files (e.g. projections) created with the ibis.iSDM-package. It is possible to write outputs of fitted DistributionModel, BiodiversityScenario or individual terra or stars objects. In case a data.frame is supplied, the output is written as csv file. For creating summaries of distribution and scenario parameters and performance, see write_summary()

Usage

write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

# S4 method for class 'ANY,character'
write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

# S4 method for class 'BiodiversityScenario,character'
write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

# S4 method for class 'SpatRaster,character'
write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

# S4 method for class 'data.frame,character'
write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

# S4 method for class 'stars,character'
write_output(
  mod,
  fname,
  dt = "FLT4S",
  verbose = getOption("ibis.setupmessages", default = TRUE),
  ...
)

Arguments

mod

Provided DistributionModel, BiodiversityScenario, terra or stars object.

fname

A character depicting an output filename.

dt

A character for the output datatype. Following the terra::writeRaster options (Default: 'FLT4S').

verbose

logical indicating whether messages should be shown. Overwrites getOption("ibis.setupmessages") (Default: TRUE).

...

Any other arguments passed on the individual functions.

Value

No R-output is created. A file is written to the target direction.

Note

By default output files will be overwritten if already existing!

Examples

if (FALSE) { # \dontrun{
x <- distribution(background)  |>
 add_biodiversity_poipo(virtual_points, field_occurrence = 'observed', name = 'Virtual points') |>
 add_predictors(pred_current, transform = 'scale',derivates = 'none') |>
 engine_xgboost(nrounds = 2000) |> train(varsel = FALSE, only_linear = TRUE)
write_output(x, "testmodel.tif")
} # }