knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
library(envReport) library(envImport) library(magrittr)
The goal of envImport is to obtain, and assemble, environmental data from disparate data sources, for a geographic area of interest. As little filtering as possible occurs when obtaining data and envImport does not aim to clean, filter or tidy the data (see envClean for help there). Usually the end result of an envImport workflow is a single object that contains all records from all the data sources. Sourcing and assembling environmental rasters for the area of interest is also in scope, but poorly implemented / documented currently.
You can install the development version of envImport from GitHub with:
# install.packages("devtools") devtools::install_github("Acanthiza/envImport")
data_name
= 'data source'. Data sources are (usually) obvious sources of data. Examples are the Global Biodiversity Infrastructure Facility (GBIF) or Terrestrial Ecosystems Network (TERN). The r nrow(envImport::data_map)
data sources currently supported or with plans for development are (also see envImport::data_map
):
r paste0(data_map$data_name, ": ", data_map$desc, collapse = "\n* ")
data_map
The data_map (see table @ref(tab:dataMap)) provides a mapping from original data sources to the desired columns in the assembled data set.
knitr::kable(data_map , caption = "Data map of desired columns in the assembled data (columns) and names of columns in the original data (rows)" )
get_x
get_x
functions get data from the data source x
. Results are always saved to disk (as getting data can be slow). When run again, they load from the saved file by default. If available, get_x
functions use any R packages and functions provided by the data source (e.g. GBIF provides rgbif
r cite_package("rgbif")
and TERN provides ausplotsR
r cite_package("ausplotsR")
). The first arguments to get_x
functions are always:
aoi
: an area of interest, provided as simple feature. get_x
will turn any aoi
into a bounding box and convert to coordinates appropriate for data source x
. [Ed: is aoi
always required?]save_dir
: a directory to save the results to. The default (NULL
) leads to the file here::here("out", "ds", "x.rds")
being created and used as save_file
. ds
is for 'data source'. While the saved file is usually x.rds
, in some instances it follows the format and naming of the download from x
(e.g. GBIF data comes in a .zip
file named by the corresponding download key).get_new
: an override to force get_x
to requery the data source, even if save_file already exists...
: the dots are passed to any underlying 'native' function, such as rgbif::occ_download()
or ausplotsR::get_ausplots()
Many of the get_x
functions will only work within DEW
.
As of June 2024, get_x
functions can be run from get_data
.
unite_data
writes bio_all
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.