checkFertilityEvent_latlon: checkFertilityEvent_latlon

Description Usage Arguments Details Value Examples

View source: R/fertilityChecks.R

Description

checkFertilityEvent_latlon Checks for fertility event relevant to Hybrid Rice breeding using aWhere's API based on latitude & longitude

Usage

1
2
3
4
5
checkFertilityEvent_latlon(latitude, longitude, threshold,
  numConsecutiveDaysToCheck = 1, period_start, period_end,
  yearsToInclude = seq(2006, as.numeric(strsplit(as.character(Sys.Date()),
  split = "-")[[1]][1]), 1), smoothPlot = FALSE, saveCSV = "",
  saveFigure = "", figureDims = c(6, 3.38, "in"))

Arguments

-

latitude: the latitude of the requested location (double)

-

longitude: the longitude of the requested locations (double)

-

threshold: vector of the the temperature values that must be exceeded. Will be plotted on same figure (double)

-

numConsecutiveDaysToCheck: number of consecutive days the threshold must be exceeded to count as fertility. The final day of the period will be conisdered the fertility event. Default value is 1 (optional - double)

-

period_start: character string of the first day for which you want to retrieve data, in the form without including the year: MM-DD

-

period_end: character string of the last day for which you want to retrieve data, in the form without including the year: MM-DD

-

yearsToInclude: vector of years to use for calculating frequency of fertility events. Default is all years from 2006 to present (optional - double)

-

smoothPlot: Smooth the plot (optional - Boolean)

-

saveCSV: complete path and filename for output of saved csv. Any deviation away from ” will be treated as valid entry (optional - string)

-

saveFigure: complete path and filename for output of saved figure. Any deviation away from ” will be treated as valid entry (optional - string)

-

figureDims: Vector where 1st element is figureWidth, 2nd element is figure height, 3rd element is the units of width/height. Valid entries for 3rd element (units) is "in","cm","mm". (optional - c(numeric,numeric,string))

Details

This function generates frequency by time information related to a specific threshold being exceeded. It does this by pulling all required weather data via the aWhere API, subsets the data for only the requested years, and then calculates the frequency of the threshold veing exceeded for each day of the year. It then outputs that information in a variety of formats as specified by the user. This function only considers maxTemp

Default units are returned by the API. Latitude and longitude must be in decimal degrees.

Value

List. Element 1 is the full datset queried from API with chance of fertility appended. Element 2 is the handle for figure created

Examples

1
2
3
4
5
6
7
## Not run: checkFertilityEvent_latlon(latitude = 39.8282
                                    ,longitude = -95.5795
                                    ,threshold = c(18,20,22)
                                    ,numConsecutiveDaysToCheck = 2
                                    ,period_start = '04-28'
                                    ,period_end = '08-01')
## End(Not run)

aWhereAPI/hybridRice_aWhere documentation built on Feb. 14, 2020, 2:49 a.m.