
Shape occurrence data for integrated species distribution models
Source:R/integrated.R
export_integrated.RdIntegrated species distribution models (ISDMs) combine presence-only,
presence-absence and count data, each with its own observation model,
in one joint likelihood (Morera-Pujol et al. 2023; Zulian et al. 2021).
Model-based integration improved models of data-deficient, narrow-ranged
species compared with presence-absence data alone, though only slightly,
and improved them more clearly compared with presence-only data
(Makinen et al. 2026). preENM fits no model; export_integrated()
shapes the cleaned records into the input that the modelling packages
expect, one dataset per data type (or per source), with its
coordinates, response and the metadata they need. It does not depend on
those packages.
Arguments
- x
Records with
data_typeandresponse(frommerge_occurrences(), afterfilter_occurrences(): its result orkept()of it).- format
"generic","intSDM","PointedSDMs"or"biomod2".- split
One dataset per
"data_type"(default) or per"source". Integrated models usually give each dataset its own intercept, so sources collected with different protocols are better kept apart.- types
For data types with your own labels, the observation model of each, e.g.
c(atlas = "presence_absence", iNaturalist = "presence_only").- trials
Optional column with the number of trials (visits) of presence-absence records.
- crs
CRS of the exported coordinates (default WGS84 longitude/latitude); give the projection of your model.
- coords, points_crs
Coordinate columns and their CRS (default the
lon,latofmerge_occurrences(), WGS84).
Value
An object of class integrated_data: datasets (the generic
data.frames), export (the structure for format), summary (one
row per dataset: type, records, presences, absences, prevalence,
species), dropped and settings. See write_integrated().
Details
Formats
"generic": a list of data.frames withspecies,x,y,response,data_type,source(andtrials)."intSDM"(Mostert et al. 2025): one list per dataset with the arguments of the workflow's$addStructured():dataStructured(ansfobject, so intSDM transforms it to the workflow's projection),datasetType("PO","PA"or"Counts"),responseName,trialsName,speciesNameanddatasetName. Calldo.call(workflow$addStructured, d)for each."PointedSDMs":data, a named list ofsfobjects forstartISDM()/startSpecies(), in which presence-absence datasets have the response columnpresent, count datasetscountsand presence-only datasets no response column (that is how PointedSDMs recognises them); andargs, the matching arguments (responsePA,responseCounts,trialsPA,Projection,speciesName)."biomod2"(Gueguen et al. 2026): one list per dataset and species with the arguments ofBIOMOD_FormatingData():resp.name(with spaces and underscores replaced by dots, as biomod2 does),resp.var,resp.xyanddata.type("binary"for presence-only and presence-absence data,"count"for whole-number counts,"abundance"otherwise). biomod2 models each data type separately and does not integrate them; presence-only datasets need its pseudo-absence arguments (PA.nb.rep, ...).
Checks. Records without a response are dropped; presence-only records with response 0 (absences inside presence-only data) are dropped, and reported. The printout warns about presence-absence datasets without absences or without presences (they cannot inform a presence-absence likelihood), about very low or high prevalence and about small datasets.
References
Morera-Pujol, V., Mostert, P.S., Murphy, K.J., Burkitt, T., Coad, B., McMahon, B.J., Nieuwenhuis, M., Morelle, K., Ward, A.I., Ciuti, S. (2023) Bayesian species distribution models integrate presence-only and presence-absence data to predict deer distribution and relative abundance. Ecography 2023, e06451. doi:10.1111/ecog.06451
Zulian, V., Miller, D.A.W., Ferraz, G. (2021) Integrating citizen-science and planned-survey data improves species distribution estimates. Diversity and Distributions 27, 2498-2509. doi:10.1111/ddi.13416
Mostert, P.S., O'Hara, R.B., Finstad, A.G., Isaac, N.J.B. et al. (2025) intSDM: an R package for building a reproducible workflow for the field of integrated species distribution models. Ecology and Evolution 15, e71029. doi:10.1002/ece3.71029
Gueguen, M. et al. (2026) biomod2: extending presence-absence species distribution models to multiple data types. Ecography 2026, e08588. doi:10.1002/ecog.08588
Makinen, J., Cohen, J., Jetz, W. (2026) Model-based data integration improves species distribution models for data-deficient and narrow-ranged hummingbird species. Diversity and Distributions, e70157. doi:10.1111/ddi.70157
Examples
po <- data.frame(lon = c(10.1, 10.4, 11.2), lat = c(46.1, 46.3, 46.8),
species = "Aus bus")
pa <- data.frame(lon = c(10.2, 10.6, 11.0, 11.3),
lat = c(46.2, 46.5, 46.6, 46.9),
species = "Aus bus", present = c(1, 0, 0, 1))
m <- merge_occurrences(GBIF = po, survey = pa,
data_type = c(survey = "presence_absence"))
#> Merged records: GBIF = 3, survey = 4
#> Data types: presence_absence = 4, presence_only = 3
ex <- export_integrated(m, "PointedSDMs")
ex
#> Input for integrated SDMs (PointedSDMs): 2 dataset(s), 7 records
#>
#> IN SHORT
#> - 1 presence-only, 1 presence-absence dataset(s).
#> - presence_only: 3 presence-only records.
#> - presence_only has fewer than 30 records: the parameters that belong to it
#> alone (its intercept and observation process, or a separate model) will
#> be poorly estimated.
#> - presence_absence: 4 presence-absence records (2 with presence, 2
#> absences; prevalence 50%).
#> - presence_absence has fewer than 30 records: the parameters that belong to
#> it alone (its intercept and observation process, or a separate model)
#> will be poorly estimated.
#>
#> dataset data_type records presences absences prevalence
#> presence_only presence_only 3 3 0 NA
#> presence_absence presence_absence 4 2 2 0.5
#> species
#> 1
#> 1
#>
#> prevalence = share of records with presence (or a count above 0). The
#> limits (fewer than 30 records, prevalence below 5% or above 95%) are preENM
#> defaults, not from the literature. Coordinates are in EPSG:4326.
names(ex$export$data)
#> [1] "presence_only" "presence_absence"
ex$export$args
#> $responsePA
#> [1] "present"
#>
#> $responseCounts
#> [1] "counts"
#>
#> $trialsPA
#> NULL
#>
#> $Projection
#> [1] "EPSG:4326"
#>
#> $speciesName
#> [1] "species"
#>