Package 'bbsTaiwan'

Title: Streamline Taiwan Breeding Birds Survey (BBS) Data Retrieval and Analysis
Description: The goal of bbsTaiwan is to streamline the retrieval and analysis of Taiwan Breeding Bird Survey (BBS) data. This package facilitates data access from GBIF, where Taiwan BBS data are stored. While the data is openly available on GBIF, its complex arrangement in the Darwin Core format can make it challenging to understand and use, often requiring advanced data wrangling skills. The bbsTaiwan package is designed to simplify this process, making it easier to access and utilize Taiwan BBS data.
Authors: Sunny Tseng [aut, cre]
Maintainer: Sunny Tseng <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2024-11-24 05:58:13 UTC
Source: https://github.com/SunnyTseng/bbsTaiwan

Help Index


Fetch BBS Occurrence Data by Species

Description

This function fetches occurrence data for specified target species, utilizing both the event and occurrence tables from GBIF. The fetched dataset undergoes the following processing steps:

  1. Join: Combines the event, occurrence, and measurementorfacts datasheets from GBIF into a single cohesive dataset.

  2. Filter: Retains only the observations for specified species using the target_species argument. The entered Chinese common name was linked to scientific name by bbs_translate.

  3. Zero Fill: Converts implicit missing values into explicit ones by filling in zeros for trips where the target species was not observed. Specifically, if a plot was visited during a particular year or trip but the target species was not observed, the species count will show a value of 0 for that row.

Usage

bbs_fetch(target_species)

Arguments

target_species

Character string specifying the Chinese common name of the species of interest. It can accept a single character string, such as target_species = "紅嘴黑鵯", or a vector, such as target_species = c("紅嘴黑鵯", "白耳畫眉").Use "全部" to return all species.

Value

A tibble containing the species occurrence data.

Examples

# For single species data fetch
bbs_fetch(target_species = "紅嘴黑鵯")

# For multiple species data fetch
bbs_fetch(target_species = c("紅嘴黑鵯", "白耳畫眉"))

# To return data for all species
bbs_fetch(target_species = "全部")

# The function will return NULL if the target species is not found in the
# BBS species list
bbs_fetch(target_species = "隨機鳥")

Examine the Number of BBS Sites Surveyed Each Year

Description

This function returns the number of sites surveyed each year in the BBS Taiwan project. Sites were mapped into five regions: East, West, South, North, and Mountain (elevation higher than 1,000 m).

Usage

bbs_history(type = "plot")

Arguments

type

Character string specifying the output format: either "table" or "plot". Default value type = "plot"

Value

A tibble or a ggplot showing the number of sites surveyed each year across regions.

Examples

# Return the number of sites in a table
bbs_history(type = "table")

# Return the number of sites in a bar chart
bbs_history(type = "plot")

Visualize Species Distribution Across All BBS Sites

Description

This function visualizes the sites surveyed for breeding birds in Taiwan, highlighting the presence and absence of specific species. It is designed upon the function bbs_fetch and bbs_translate.

Usage

bbs_plotmap(target_species)

Arguments

target_species

Character string specifying the scientific name of the species of interest. It can accept a single character string, such as target_species = "紅嘴黑鵯", or a vector, such as target_species = c("紅嘴黑鵯", "白耳畫眉"). The function can accept up to plotting 5 species in one figure. Use NULL to return a map of site distribution.

Value

A ggplot object showing the distribution map.

Examples

# For single species distribution
bbs_plotmap(target_species = "紅嘴黑鵯")

# For multiple species distribution
bbs_plotmap(target_species = c("紅嘴黑鵯", "白耳畫眉"))

# Simply the distribution of the surveyed sites
bbs_plotmap(target_species = NULL)

Return the Coordinates of All BBS Sites

Description

This function returns the coordinates of all BBS sites that were surveyed. No arguments are needed. The coordinates are reported using the WGS84 projection system. Use terra::vect(geom = c("decimalLatitude", "decimalLongitude"), crs = "epsg:4326") to transform the table to spatial object.

Usage

bbs_sites()

Details

The source data comes from the event table in the GBIF dataset.

Value

A tibble including the coordinates of all BBS survey sites, in WGS84.

Examples

# Get the full list of BBS sites in a tibble
bbs_sites()

# Transform BBS sites into a spatial object using terra package
bbs_sites() |>
terra::vect(geom = c("decimalLatitude", "decimalLongitude"), crs = "epsg:4326")

Translate Bird Species' Chinese Common Name to Scientific Name

Description

This function is intended for use under bbs_fetch and bbs_plotmap. This function helps users find the scientific names of birds from their Chinese common names for species found in Taiwan.

Usage

bbs_translate(target_species)

Arguments

target_species

A single character string or a vector of character strings representing species' names in Chinese.

Value

A vector of bird species' scientific names. If the input species name is not included in the bird list of Taiwan, NA will be returned. Please check for any typos.

Examples

# For a single species
bbs_translate("白頭翁")

# For multiple species
bbs_translate(target_species = c("烏頭翁", "白頭翁", "紅嘴黑鵯", "白耳畫眉"))

BBS Taiwan bird list

Description

A list of bird species that recorded in BBS Taiwan, including the scientific name, Chinese name, English name

Usage

bird_info

Format

A data frame with 909 rows and 4 columns:

scientificName

scientific name

chineseName

all possible Chinese that were used for the species

englishName

english name from Taiwan Wild Bird Federation

scientificName_t

scientific name from Taiwan Wild Bird Federation

...

Source

https://drive.google.com/drive/folders/1ex6EDkXv82mpEKcPkOYrQJ_anlu3pI1E


BBS Taiwan raw dataset on GBIF - event

Description

A dataframe record BBS Taiwan event info. This is a raw dataset, which was downloaded directly from GBIF without any wrangling or cleaning.

Usage

event

Format

A data frame with 423,139 rows and 18 columns:

id
eventID
parentEventID
samplingProtocol
sampleSizeValue
sampleSizeUnit
samplingEffort
eventDate
eventTime
locationID
country
countryCode
locality
decimalLatitude
decimalLongitude
geodeticDatum
coordinateUncertaintyInMeters
coordinatePrecision

...

Source

https://www.gbif.org/zh-tw/dataset/f170f056-3f8a-4ef3-ac9f-4503cc854ce0


BBS Taiwan raw dataset on GBIF - extendedmeasurementorfact

Description

A dataframe record BBS Taiwan extendedmeasurementorfact, which contains info for associated occurrence record, such as time, location. This is a raw dataset, which was downloaded directly from GBIF without any wrangling or cleaning.

Usage

extendedmeasurementorfact

Format

A data frame with 1,649,589 rows and 7 columns:

id
measurementID
measurementType
measurementValue
measurementDeterminedDate
measurementDeterminedBy
measurementMethod

...

Source

https://www.gbif.org/zh-tw/dataset/f170f056-3f8a-4ef3-ac9f-4503cc854ce0


BBS Taiwan raw dataset on GBIF - measurementorfacts

Description

A dataframe record BBS Taiwan measurementorfacts, which contains info for associated event record, such as time, location. This is a raw dataset, which was downloaded directly from GBIF without any wrangling

Usage

measurementorfacts

Format

A data frame with 1,649,589 rows and 7 columns:

id
measurementID
measurementType
measurementValue
measurementDeterminedDate
measurementDeterminedBy
measurementMethod

...

Source

https://www.gbif.org/zh-tw/dataset/f170f056-3f8a-4ef3-ac9f-4503cc854ce0


BBS Taiwan raw dataset on GBIF - occurrence

Description

A dataframe record BBS Taiwan occurrence info. This is a raw dataset, which was downloaded directly from GBIF without any wrangling or cleaning.

Usage

occurrence

Format

A data frame with 385,131 rows and 11 columns:

id
basisOfRecord
occurrenceID
recordedBy
individualCount
occurrenceRemarks
eventID
scientificName
family
genus
vernacularName

...

Source

https://www.gbif.org/zh-tw/dataset/f170f056-3f8a-4ef3-ac9f-4503cc854ce0


Elevation raster of Taiwan

Description

A raster in dataframe xyz format, representing the elevation of Taiwan in 1m by 1m grids. The data were reprojected to WGS84 (EPSG:4326).

Usage

tw_elev

Format

A data frame with 38,575 rows and 3 columns:

x

scientific name

y

all possible Chinese that were used for the species

G1km_TWD97-121_DTM_ELE

english name from Taiwan Wild Bird Federation

...

Source

https://github.com/WanJyunChen/Taiwan_environmental_dataset


Map of Taiwan

Description

A sf file created by reading in shape file, showing the outline of Taiwan. The crs is WGS84 (EPSG:4326).

Usage

tw_map

Format

A sf object with 1 feature and 67 fields

Source

https://geodata.libraries.mit.edu


Map of eco-regions in Taiwan

Description

There are three regions: North, West, and East, representing different ecosystems in Taiwan specifically for avian biodiversity. This map was developed by Hau-Jie Shiu in 2003.

Usage

tw_region

Format

Need more info

Source

https://ndltd.ncl.edu.tw/cgi-bin/gs32/gsweb.cgi/login?o=dnclcdr&s=id=%22091NTU00312007%22.&searchmode=basic