boettiger-lab / gpdd

:package: for the Global Population Dynamics Database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gpdd

Travis Build Status AppVeyor Build Status codecov.io CRAN Status lifecycle Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

This package provides an efficient way to access datasets in the Global Population Dynamics Database (GPDD) from the KNB website.

Quick start

Installation

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")

Usage

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")

About

:package: for the Global Population Dynamics Database

License:BSD 2-Clause "Simplified" License


Languages

Language:R 100.0%