README.md

Obtaining data from the BWG database

last updated Andrew, Diane, Sandra Feb 2024

A simple package to access our (currently private) API for the bromelaid working group database.

Installation

This package is not yet on CRAN. To install directly from github, use devtools:

library(devtools)
install_github("Srivastavalab/bwgdata")

If you don't have devtools, you can try the much more lightweight ghit

install.packages(ghit)
library(ghit)
install_github("Srivastavalab/bwgdata")

usage

Before accessing data from our database, you'll need a valid username and password.

Step 1: Authenticate

First, you need to tell R your username and password:

library(bwgdata)
bwg_auth()

You will be prompted for your username and your password. The latter will be "masked" to protect your privacy. After entering your password, one of two things will happen:

If some third thing happens, please tell me! This would be very unusual.

Step 2: access data

Right now there's only one data-obtaining function:

bwg_get("datasets")

bwg_get("visits")

bwg_get("bromeliads")

There are two ways of getting the species: with or without the Tachet traits:

# just the species pls
bwg_get("species")

# both species and traits
bwg_get("species", list(traits = "true"))


SrivastavaLab/bwgdata documentation built on Feb. 1, 2024, 11:34 a.m.