generateaWhereDataset: generateaWhereDataset

Description Usage Arguments Details Value References Examples

View source: R/generateaWhereDataset.R

Description

generateaWhereDataset Generate a basic aWhere weather dataset for a given point and timespan.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
generateaWhereDataset(
  lat,
  lon,
  day_start,
  day_end,
  year_start,
  year_end,
  verbose = TRUE,
  appendPrevDataPull = TRUE,
  removeFeb29Data = FALSE
)

Arguments

lat

numeric latitude point in decimal degrees (required)

lon

numeric longitude point in decimal degrees (required)

day_start

character string in YYYY-MM-DD format, denoting the first day for which you want weather data retrieved (required)

day_end

character string in YYYY-MM-DD format, denoting the last day for which you want weather data retrieved (required)

year_start

numeric in YYYY format, denoting the first year of data which should be included in the norms calculation. (required)

year_end

numeric in YYYY format, denoting the last year of data which should be included in the norms calculation (required)

verbose

print additional diagnostic messages during runtime (optional)

appendPrevDataPull

disable behavior for R to request and append only novel data for the current location but instead to create data object fresh at all times (optional)

removeFeb29Data

automatically remove Feb 29th data (optional)

Details

This function returns an organized dataset from the aWhere API with a pre-set list of variables for the given coordinates and spanning the entire input datespan, which can include forecasted dates. Forecast data will be returned in 24-hour/1-day blocks, in order to be harmonious with the past observed data. The pre-set variables include temperature, rainfall, PET, P/PET, GDDs, and variable accumulations. The pre-set list is not customizable. Users who wish to investigate other variables returned by the aWhere API - like humidity, solar radiation, and more - should use the base functions provided in the aWhereAPI package. This function is intended to get a user started with retrieving data and analyzing it quickly, without the need for making multiple function calls or merging the results.

Value

dataframe with the following schema: latitude, longitude, date, day, accumulatedGdd.amount, accumulatedGdd.average, accumulatedGdd.stdDev, accumulatedPet.amount, accumulatedPet.average, accumulatedPet.stdDev, accumulatedPpet.amount, accumulatedPpet.average, accumulatedPpet.stdDev, accumulatedPrecipitation.amount, accumulatedPrecipitation.average, accumulatedPrecipitation.stdDev, gdd.amount, gdd.average, gdd.stdDev, pet.amount, pet.average, pet.stdDev, ppet.amount, ppet.average, ppet.stdDev, precipitation.amount, precipitation.average, precipitation.stdDev, relativeHumidity.max.amount, relativeHumidity.max.average, relativeHumidity.max.stdDev, relativeHumidity.min.amount, relativeHumidity.min.average, relativeHumidity.min.stdDev, solar.amount, solar.average, solar.stdDev, temperatures.max.amount, temperatures.max.average, temperatures.max.stdDev, temperatures.min.amount, temperatures.min.average, temperatures.min.stdDev, wind.average.amount, wind.average.average, wind.average.stdDev, wind.dayMax.amount, wind.dayMax.average, wind.dayMax.stdDev

References

http://developer.awhere.com/api/reference/

Examples

1
2
3
4
5
6
7
## Not run: generateaWhereDataset(lat = 30.685
                              ,lon = 72.928
                              ,day_start = "2018-09-01"
                              ,day_end = "2019-01-20"
                              ,year_start = 2008
                              ,year_end = 2018)
## End(Not run)

aWhereAPI/aWhere-R-Charts documentation built on Dec. 30, 2021, 12:58 p.m.