processClimateIndices: processClimateIndices

Description Usage Arguments Details Value References Examples

View source: R/processClimateIndices.R

Description

processClimateIndices Process aWhere weather data to generate climate indices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
processClimateIndices(
  dataToUse,
  variable,
  variable_rightAxis = NULL,
  startYearOfSeasonToPlot = NULL,
  season.monthDay_start = "01-01",
  season.monthDay_end = "12-31",
  years.LTN = seq(2006, 2020, 1),
  title = NULL,
  e_precip = FALSE,
  e_threshold = 35,
  indexSpecificValue = NULL,
  offline_mode = FALSE
)

Arguments

variable

character string denoting the variable to chart. Acceptable values are maxLenDrySpell, maxLenWetSpell, numFrostDays, numSummerDays, numIcingDays, numTropicalNights, minOfMaxTemp, maxOfMaxTemp, minOfMinTemp, maxOfMinTemp, dailyTempRange, maxSingleDayPrecip, max5ConsDayPrecip, simplePrecipIntensityIndex, precipSumExceedPercentile, warmSpellDurIndex, coldSpellDurIndex, countDaysPrecipExceedAmount, percentDaysMinTempBelowQuantile, percentDaysMaxTempBelowQuantile, percentDaysMinTempAboveQuantile, percentDaysMaxTempAboveQuantile, maxOfAccumulatedPet, sumOfGDD, sumOfPET, sumOfPrecip, sumOfSolar, sumOfPOverPET, averageMaxTemp, averageMinTemp, averageMaxRH, averageMinRH, averageWind, and maxWindGust

variable_rightAxis

What variable to plot over the primary variable. The right y-axis of the plot will be used to present its range. Note that it will always be plotted as a line chart. Same valid values as the variable param. (optional)

startYearOfSeasonToPlot

Specify the start year of the "season" you want plotted for the current time period. For example if you specify 2020 here and season.monthDay_start is '08-01' and season.monthDay_end is '12-15' the current time period will begin on '2020-01-01' and end on '2020-12-15'. Dates will be adjusted properly if the season goes over Jan 1st.

season.monthDay_start

Specify the start month-day combination of the "season" you want analyzed (optional)

season.monthDay_end

Specify the end month-day combination of the "season" you want analyzed (optional)

years.LTN

specify the years over which you want the LTN calculated. Defaults to 2006-2020 (optional)

title

character string of title to assign to the plot. (optional)

e_precip

logical, if set to TRUE, effective precipitation will be calculated and charted based on e_threshold. Default is set to FALSE. (optional)

e_threshold

numeric value (in milimeters) for the daily maximum used to calculate effective precipitation if e_precip is set to TRUE. (optional)

indexSpecificValue

For the Climate Indices this tool can plot the user can override the default value of the index using this parameter (optional)

offline_mode

Set to TRUE to work in offline mode and not attempt to fetch data from the aWhere API (optional)

data

data frame in which variables are named according to the schema output by generateaWhereDataset.R (required)

Details

This function extends the aWhere charts package to generate the ETCCDI climate change indices (reference below). Most indices are implement with the default behavior described int he publication. Default values of the indices can be overriden using the "indexSpecificValue" parameter.

Also has helper functions including to automatically (with user permission) download missing but needed data and store in the aWhereEnv to persist it throughout a user R session.

Value

list

References

http://etccdi.pacificclimate.org/list_27_indices.shtml

Examples

1
2
3
4
5
6
7
8
## Not run: processClimateIndices(data = weather_df
                                     ,variable = "seasonTotalPrecip"
                                     ,season.monthDay_start = '09-01'
                                     ,season.monthDay_end = '11-30'
                                     ,years.LTN = seq(2010,2019,1)
                                     ,e_precip = TRUE
                                     ,e_threshold = 10)
## End(Not run)

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