View source: R/filter_by_species.R
filter_by_species | R Documentation |
Filters FORCIS data by a species list.
filter_by_species(data, species)
data |
a |
species |
a |
A data.frame
containing a subset of data
.
# Import example dataset ----
file_name <- system.file(file.path("extdata", "FORCIS_net_sample.csv"),
package = "forcis")
net_data <- read.table(file_name, dec = ".", sep = ";")
# Add 'data_type' column ----
net_data$"data_type" <- "Net"
# Select a taxonomy ----
net_data <- select_taxonomy(net_data, taxonomy = "VT")
# Select only required columns (and taxa) ----
net_data <- select_forcis_columns(net_data)
# Dimensions of the data.frame ----
dim(net_data)
# Get species names ----
get_species_names(net_data)
# Select records for three species ----
net_data_sub <- filter_by_species(data = net_data,
species = c("g_inflata_VT",
"g_elongatus_VT",
"g_glutinata_VT"))
# Dimensions of the data.frame ----
dim(net_data_sub)
# Get species names ----
get_species_names(net_data_sub)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.