View source: R/import_inv_taxa.R
import_inv_taxa | R Documentation |
The import_inv_taxa function imports macroinvertebrate taxon abundance information from the Environment Agency's Ecology and Fish Data Explorer (EDE). The function downloads and merges two files: one listing taxon abundances by sample, and one with details of each taxon (e.g. full taxon name, taxonomic rank). The data can be optionally filtered by site and/or sample ID, and the filtered data saved as a .rds file.
import_inv_taxa(sites = NULL,
samples = NULL,
save = FALSE)
sites |
Vector of site ids to filter by. Default = NULL |
samples |
Vector of sample ids to filter by. Default = NULL |
save |
Specifies whether (TRUE) or not (FALSE) the filtered data should be saved as an rds file (for future use, or audit trail). Default = FALSE. |
If saving a copy of the filtered taxa data, the name of the rds file is hard-wired to INV_OPEN_DATA_TAXA_F.RDS
.
Downloaded raw data files will be automatically removed from the working directory following execution of the function.
The function automatically modifies the output from EDE, renaming "SITE_ID" to "biol_site_id" (hetoolkit
's standardised column header for biology site ids).
Please note that that approaches to sample processing, such as abundance recording, have changed over time. For details, please see page 5 of this pdf document
A tibble containing the imported macroinvertebrate taxonomic abundance data.
# Import data from EDE for specific sites
taxa_data <- import_inv_taxa(sites = c("34310", "34343"))
# Import data using sample IDs
biol_data <- hetoolkit::import_inv(sites = c("34310", "34343"))
sample_IDs <- unique(biol_data$SAMPLE_ID)
taxa_data <- import_inv_taxa(samples = sample_IDs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.