getHilltopData: General function to get timeseries data from a Hilltop...

View source: R/hillr_requests.R

getHilltopDataR Documentation

General function to get timeseries data from a Hilltop server.

Description

getHilltopData retrieves time series data from a Hilltop server.

Usage

getHilltopData(
  endpoint,
  site,
  measurement,
  from = NULL,
  to = NULL,
  timeInterval = NULL,
  tsType = NULL,
  alignment = NULL,
  method = NULL,
  interval = NULL,
  gapTolerance = NULL,
  showFinal = NULL,
  dateOnly = NULL,
  showQuality = "Yes"
)

Arguments

endpoint

string A valid hilltop endpoint.

site

string A site that has data available on the server.

measurement

string A measurement that has data available for the requested site on the server.

from

string (optional) The date (or date time combination) that data is required from (if not provided only the last measurement will be provided.)

to

string (optional) The date (or date time combination) that data is required up to (if not provided data will be provided from the from date to the most recent data available.)

timeInterval

string (optional) A time interval that data is requested over, either of the form P1D, or P3M, or fromDateTime/toDateTime.

tsType

string (optional) The type of time series being requested. Default is StdTimeSeries, but quality code data can be obtained using tsType = StdQualSeries.

alignment

string (optional) A time or keyword that the data should be aligned to.

method

string (optional) A statistical method to apply to the data. The options are Interpolate, Average, Total, Moving Average, EP and Extrema. Interpolate - Provide data aligned with the requested interval. Average - Provide the average of the measurement across the interval. Total - Provide the total in the interval. Moving Average - Provide the moving average in the interval, timestamped to half of the interval. EP - Provide the exceedence percentile based on the whole available dataset. Extrema - Provide the Min, Mean, Max, Amount of missing record (s) ,Time of Min and Time of Max over the interval.

interval

string (optional) The interval for the statistic to be computed over. eg 1 Day, 1 Month etc.

gapTolerance

string (optional) The gap tolerance interval for the statistic. Default is no gap tolerance, ie if there are gaps in the interval a 0 result is returned. If you want to ignore gaps completely then set the gap tolerance to the same as the Interval. Accepts either an interval such as 1 Day, or 1 Month, or the word Interval if you want to use the same period as provided in the interval parameter.

showFinal

string (optional) Options are Yes, or No, default is Yes. If Yes then if the data stops part way through the last interval then the total in the interval is provided

dateOnly

string(optional) Whether the returned timestamp should be the date, with no time. Default is date and time. Allowed values are Yes and No (default No) This is useful when working with intervals ove a day or more as the returned value will be the end of the interval, ie midnight on the day after the last day of the period. This can be confusing as a monthly total for March would be timestamped as midnight on 1 April. Setting dateOnly to Yes would return a date of 31 March.

showQuality

string(optional) Options are Yes or No, default is Yes. Whether Quality Codes are returned with the data. If quality codes are available they are returned.

Details

Takes a valid Hilltop server endpoint, a site name, a measurement name and optional from, to or timeIntervaland arguments, an optional timeseries type argument and returns a dataframe of the data for that site and measurement for the requested time range from the endpoint. For standard time series, statistics can be obtained, to request these a method, interval and allignment argument need to be provided. If statistics are requested the amount of gap in the data can be specified as an interval.

Value

dataframe A dataframe of the timeseries data.


jeffcnz/hillr documentation built on Nov. 21, 2024, 11:58 p.m.