View source: R/get_bio_oracle_v2.R
get_bio_oracle_v2 | R Documentation |
This function retrieves environmental and climatic data layers from BioOracle v2 based on different combinations of parameters
such as the time period, RCP (emission scenarios), depth, variable, and statistics. Data can be downloaded in tif
or asc
format
and saved in the specified directory.
get_bio_oracle_v2(
period = "Present",
rcp = NULL,
depth = "Benthic.Min",
variable = "Temperature",
stat = "all",
format = "tif",
save_path = "."
)
period |
A character string specifying the time period for which to retrieve the data. Options are "Present", "2050", or "2100". The default is "Present". |
rcp |
A character string or vector of characters specifying the greenhouse gas emission scenarios to consider.
Can be one or more of: "RCP26", "RCP45", "RCP60", "RCP85". The default is |
depth |
A character string specifying the depth level for the data. Options are: "Benthic.Min", "Benthic.Max", "Benthic.Mean", "Surface". The default is "Benthic.Min". |
variable |
A character string or vector of characters specifying the variable to retrieve data for. Options include: "Temperature", "Salinity", "Primary.productivity", "pH", "Iron", "Ice.thickness", "Ice.cover", "Current.Velocity", "Nitrate", "Phosphate", "Silicate", "Dissolved.oxygen", "Chlorophyll", "Phytoplankton", "Calcite", "Par", "Diffuse.attenuation", "Cloud.cover", "Sea". The default is "Temperature". |
stat |
A character string or vector of characters specifying the statistics to calculate for the selected variable. Options are: 'Min', 'Max', 'Mean', 'Lt.max', 'Lt.min', 'Range'. The default is "all", which selects all statistics. |
format |
A character string specifying the file format for saving the data. Options are "tif" or "asc". The default is "tif". |
save_path |
A character string specifying the directory where the downloaded and processed files will be saved. The default is the current directory ("./"). |
This function filters the BioOracle v2 data based on the selected parameters and downloads the corresponding layers.
If the specified save_path
does not exist, the function will create the necessary folders to store the files.
The downloaded files are unzipped, renamed according to the query parameters, and loaded into a SpatRaster
object for further analysis.
A SpatRaster
object from the terra
package containing the processed and downloaded data layers.
If no data is found for the selected parameters, the function will stop and display an error message.
## Not run:
# Download data for the present period and the variable 'Temperature'
bioracle_layers <- get_bio_oracle_v2(period = "Present",
depth = "Surface",
variable = "Temperature",
save_path = ".")
# Download data for the 2050 period, RCP85, and the variable 'Chlorophyll'
bioracle_layers <- get_bio_oracle_v2(period = "2050",
depth = "Surface",
rcp = "RCP85",
variable = "Temperature",
format = "tif",
save_path = ".")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.