Learn R Programming

caretSDM (version 1.1.0.1)

join_area: Join Area

Description

Join cell_id data from sdm_area to a occurrences

Usage

join_area(occ, pred)

Value

A occurrences object with cell_id to each record.

Arguments

occ

A occurrences object or input_sdm.

pred

A sdm_area object to retrieve cell_id from.

Author

Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com

Details

This function is key in this SDM workflow. It attaches cell_id values to occ, deletes records outside pred and allows the use of pseudoabsences. This function also tests if CRS from both occ and pred are equal, otherwise the CRS of pred is used to convert occ.

See Also

occurrences_sdm sdm_area input_sdm pseudoabsences

Examples

Run this code
# Create sdm_area object:
sa <- sdm_area(parana, cell_size = 50000, crs = 6933)

# Include predictors:
sa <- add_predictors(sa, bioc) |> select_predictors(c("bio1", "bio4", "bio12"))

# Include scenarios:
sa <- add_scenarios(sa, scen)

# Create occurrences:
oc <- occurrences_sdm(occ, crs = 6933) |> join_area(sa)

Run the code above in your browser using DataLab