makeDataset: make a dataframe of stations records for each requested hour

Description Usage Arguments Value Author(s) Examples

View source: R/makeDataset.R

Description

make a dataframe of stations records for each requested hour

Usage

1
2
3
4
5
makeDataset(user_token = Sys.getenv("AGROMET_API_V1_KEY"),
  api_request = "https://app.pameseb.be/agromet/api/v2/sp/cleandata",
  sensors = "tsa", stations = "all", stations_meta = stations.df,
  dfrom = NULL, dto = NULL, json = NULL, staticExpl = "elevation",
  dynExpl = NULL)

Arguments

sensors

a character vector specifying the name of the sensors for which you data. One of tsa, hct, hra, ens, plu, vvt.

stations

a character vector specifying the sid's of the stations to use.

dfrom

a datetime string specifying the dateTime from which you want data Must have the form "YYYY-MM-DDTHH:MM:SSZ"

dto

a datetime string specifying the dateTime to which you want data Must have the form "YYYY-MM-DDTHH:MM:SSZ"

json

a character specifying the path of a json file constructed from a batch db export. If NULL the API will be called.

staticExpl

a character vector specifying the desired static explanatory variables Any combinations of "elevation", "slope", "aspect", "Agricultural_areas", "Artificials_surfaces", "Forest", "Herbaceous_vegetation". Latitude and longitude are always provided. Default = "Elevation"

dynExpl

a character vector specifying the dynamic explanatory variables you want to add to the task. Any combinations of inca, ens

token

a character specifying your agrometAPI token

Value

A 2 elements named list

Author(s)

Thomas Goossens

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# get the dataset
myDataset = makeDataset(
  dfrom = "2017-03-04T15:00:00Z",
  dto = "2017-03-04T15:00:00Z",
  sensor = "tsa")

# extract the data
myDataset = myDataset$output$value

# each dataframe is stored in a list
class(myDataset)

# show the head of the first dataframe
head(myDataset[[1]])

## End(Not run)

pokyah/agrometeoR documentation built on May 26, 2019, 7 p.m.