knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This package provides an efficient way to access datasets in the Global Population Dynamics Database (GPDD) from the KNB website.
gpdd can be installed with the following code:
install.packages("devtools") # if you haven't installed the "devtools package"
devtools::install_github("boettiger-lab/gpdd")
This package contains two functions: download_gpdd and load_gpdd. download_gpdd takes three arguments: dataset_name (the requested dataset), dir (the directory to be downloaded/loaded), and overwrite (whether to overwrite existing datasets). Allowed dataset_name inputs are "gpdd_data", "gpdd_main", "gpdd_timeperiod", "gpdd_taxon", "gpdd_datasource", "gpdd_biotope" and "gpdd_location", or a character vector containing several of those; other inputs will raise an error. Default argument of dir is the directory created by rappdirs::user_data_dir("gpdd"). The user can also specify a specific directory. Default argument of overwrite is "Ask", where it asks the user to specify whether to overwrite an existing dataset whenever encountering one. The user can also specify "Yes" or "No" for all datasets. Example below:
# By default, all seven datasets will be downloaded/loaded. download_gpdd(overwrite = "No") gpdd <- load_gpdd() summary(gpdd$data) summary(gpdd$main) # Specifying the dataset to be downloaded/loaded. download_gpdd(c("gpdd_location", "gpdd_timeperiod"), overwrite = "No") gpdd <- load_gpdd(c("location", "gpdd_timeperiod")) summary("gpdd$location") summary("gpdd$timeperiod") # Changing "overwrite" argument. download_gpdd(c("gpdd_location", "gpdd_timeperiod"), overwrite = "Yes") download_gpdd(c("gpdd_location", "gpdd_timeperiod"), overwrite = "No")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.