createEnvDataGrid: Create gridded data for querying Movebank Env-Data

Description Usage Arguments Value See Also Examples

View source: R/createEnvDataGrid.R

Description

Takes a vector of latitudes and longitudes (typically evenly spaced) and a vector of times and generates the strictly formatted data frame needed to upload to Env-Data to obtain covariates for movebank. Essentially, an R-based substitute for the "gridded data" tool.

Usage

1
2
3
4
5
6
7
8
9
createEnvDataGrid(
  lats,
  lons,
  start,
  finish = start,
  dt = 0,
  savefile = TRUE,
  fileout = NULL
)

Arguments

dt

time interval between desired time points.

savefile

whether to save a csv file

fileout

name of csv file to save

lats, lons

vectors of latitude and longitude for the desired grid. Can also be a single location.

start, finish

vectors of POSIX times of start and finish for the query.

Value

Either nothing (if csv file saved) or the character string data frame with correct formatting.

See Also

createEnvDataRequest, uploadEnvDataRequest, createEnvDataDataFrame

Examples

1
2
3
4
5
6
7
 lats <- seq(38.8, 39.0, length = 40)
 lons <- seq(-77.12, -76.91, length = 40) 
 start <- ymd("2014-01-01")
 finish <- ymd("2014-12-31")
 dt <- ddays(20)
 example <- createEnvDataGrid(lats, lons, start, finish, dt, savefile = FALSE)
 head(example)

ABoVE-AotM/above documentation built on May 28, 2020, 6:08 a.m.