This function downloads GBIF data for all vascular plants within a specified geographical area (Europe), grouped by order, and converts the data to raster format to represent the number of vascular plant observations and species per grid cell.
Usage
Efforts_Process(
FromHPC = TRUE,
EnvFile = ".env",
Renviron = ".Renviron",
RequestData = TRUE,
DownloadData = TRUE,
NCores = 6,
StartYear = 1981,
Boundaries = c(-30, 50, 25, 75),
ChunkSize = 1e+05,
DeleteChunks = TRUE,
DeleteProcessed = TRUE
)
Arguments
- FromHPC
Logical indicating whether the work is being done from HPC, to adjust file paths accordingly. Default:
TRUE
.- EnvFile
Character. The path to the environment file containing variables required by the function. Default:
.env
.- Renviron
Character. The path to the
.Renviron
file containing GBIF login credentials (email, user, password). Default:.Renviron
.- RequestData
Logical. If
TRUE
, the function requests data from GBIF. IfFALSE
, previously requested data is loaded from disk. Defaults toTRUE
.- DownloadData
Logical. If
TRUE
, the function downloads data and stores it on disk. IfFALSE
, it skips the download step. Defaults toTRUE
.- NCores
Integer. The number of cores to use for parallel processing.
- StartYear
Numeric. The starting year for the occurrence data. Only records from this year onward will be requested from GBIF. Default is
1981
, which matches the year ranges of CHELSA current climate data.- Boundaries
Numeric vector of length 4. Specifies geographical boundaries for the requested GBIF data in the order: Left, Right, Bottom, Top. Default:
c(-30, 50, 25, 75)
.- ChunkSize
Integer. The number of rows per chunk file. Default:
100,000
. See Efforts_Split and Efforts_Summarize for more details.- DeleteChunks
logical, indicating whether to remove file chunks after processing the data. Defaults to
TRUE
.- DeleteProcessed
Logical indicating whether to delete the raw downloaded GBIF data after processing them. This helps to free large unnecessary file space (> 22 GB). Defaults to
TRUE
.
Value
Returns NULL
invisibly. The function generates various output
files, maps, and logs, and it is designed to be used for its side effects.
Note
This function is expected to take a substantial amount of time (>9 hours on a Windows PC with 6 cores). The data request from GBIF may take around 5 hours to be ready. The function requests GBIF data for each vascular plant order and waits for the data to be ready before processing them.
This function should be the only function to be called to prepare sampling efforts data. It calls other functions Efforts_Request to request data from GBIF, Efforts_Download to download zipped archive for each vascular plant order, Efforts_Summarize and Efforts_Split to process data in small chunks, and Efforts_Plot for plotting.