View source: R/get_table_pathways.R
get_table_pathways | R Documentation |
Function to get number of taxa introduced by different pathways. Possible breakpoints: taxonomic (kingdom + vertebrates/invertebrates), temporal (lower limit year).
get_table_pathways(
df,
category = NULL,
from = NULL,
n_species = 5,
kingdom_names = "kingdom",
phylum_names = "phylum",
first_observed = "first_observed",
species_names = "canonicalName"
)
df |
df. |
category |
NULL or character. One of the kingdoms as given in GBIF:
It can also be one of the following not kingdoms: #'
|
from |
NULL or numeric. Year trade-off: if not |
n_species |
numeric. The maximum number of species to return as examples
per pathway. For groups with less species than |
kingdom_names |
character. Name of the column of |
phylum_names |
character. Name of the column of |
first_observed |
character. Name of the column of |
species_names |
character. Name of the column of |
a data.frame with 4 columns: pathway_level1
, pathway_level2
, n
(number of taxa) and examples
.
## Not run:
library(readr)
datafile <- paste0(
"https://raw.githubusercontent.com/trias-project/indicators/master/data/",
"interim/data_input_checklist_indicators.tsv"
)
data <- read_tsv(datafile,
na = "NA",
col_types = cols(
.default = col_character(),
key = col_double(),
nubKey = col_double(),
speciesKey = col_double(),
acceptedKey = col_double(),
first_observed = col_double(),
last_observed = col_double()
)
)
get_table_pathways(data)
# Specify kingdom
get_table_pathways(data, "Plantae")
# with special categories, `Chordata` or `not Chordata`
get_table_pathways(data, "Chordata")
get_table_pathways(data, "Not Chordata")
# From 2000
get_table_pathways(data, from = 2000, first_observed = "first_observed")
# Specify number of species to include in examples
get_table_pathways(data, "Plantae", n_species = 8)
# Specify columns containing kingdom and species names
get_table_pathways(data,
"Plantae",
n_species = 8,
kingdom_names = "kingdom",
species_names = "canonicalName"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.