dl_data: Download data from original animalnexus database

Description Usage Arguments Details Examples

View source: R/dl_data.R

Description

This function uses RCurl to submit an HTML form and retrieve the csv file from the animalnexus database.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dl_data(
  start = NULL,
  end = NULL,
  url = "http://gaia.tru.ca/birdMOVES/rscripts/anquery.csv",
  tz_disp = "Etc/GMT+8",
  dst = FALSE,
  species = NULL,
  site_id = NULL,
  feeder_details,
  bird_details,
  logger_details,
  animal_details
)

Arguments

start

Character. This is the start date (inclusive, with or without time) for the data to download. There is some flexibility in the format (see details). If NULL, get records from start.

end

Character. This is the end date (inclusive, with or without time) for the data to download. There is some flexibility in the format (see details). If NULL, get records to end.

url

Character. This is the url for the database service. The default should not need to be changed.

tz_disp

Character vector. Timezone data should be displayed in (should match one of the zones produced by 'OlsonNames()')

dst

Logical. Whether or not to use Daylight Savings. When set to FALSE timezones are converted to the Etc/GMT+X timezones which do not include DST. (Note this overrides the timezone specification such that a timezone of America/Vancouver, which would normally include DST in the summer, will be transformed to a timezone with the same GMT offset, but not including DST).

species

Character. Vector of species to include (defaults to all). See details for valid entries.

site_id

Character. Vector of sites to include (defaults to all permissible). See details for valid entries.

feeder_details

Deprecated.

bird_details

Deprecated.

logger_details

Deprecated.

animal_details

Deprecated.

Details

This function is flexible with respect to date formats. Using [lubridate::parse_date_time()] from the lubridate package, the format of the date/time supplied will estimated. This allows for partial date/times to be supplied (e.g., "2015-01-01 09" or "2015-09" or "2015-09-01"). For best results, specify the date/time format as YYYY-MM-DD HH:MM:SS and truncate as needed. Note that truncated times are interpreted as 00 and trucated dates as the first of the month and the first month of the year. Thus "2015" will be sumbitted as "2015-01-01 00:00:00".

'species' options are:

‘site_id' options are either ’kl' for Kamloops, BC, or 'cr' for Costa Rica. Note that Costa Rican data is protected while the scientist work on publishing. Only users with valid credentials will be able to download this data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

# Get all data (may take a couple minutes)
r <- dl_data()

# Get all 2016 data
r <- dl_date(start = "2016")

# Get specific data
r <- dl_data(start = "2016-01-01 09:34:12",
              end = "2016-02-01")

## End(Not run)

animalnexus/feedrUI documentation built on Feb. 5, 2022, 9:08 a.m.