fullGetHilltopData: Multiple sites and measurements data to Dataframe.

View source: R/hillr_full_request.R

fullGetHilltopDataR Documentation

Multiple sites and measurements data to Dataframe.

Description

fullGetHilltopData returns a dataframe of requested measurements at sites.

Usage

fullGetHilltopData(
  endpoint,
  sites,
  measurements,
  from = NULL,
  to = NULL,
  option = NULL,
  timeInterval = NULL,
  alignment = NULL,
  method = NULL,
  interval = NULL,
  gapTolerance = NULL,
  showFinal = NULL,
  dateOnly = NULL,
  showQuality = "Yes"
)

Arguments

endpoint

string A valid hilltop endpoint.

sites

string vector The sites that data is to be requested from.

measurements

string vector The measurements that are to be requested.

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.)

option

string One of WQ, Standard or None.

timeInterval

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

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 vector of site names, a vector of measurement names and optional from, to or timeIntervaland arguments, an optional timeseries type argument, and an option argument identifying the type of metadata to be returned in the output dataframe. The function returns a dataframe of the data for the sites and measurements 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. The option argument provided determines what metadata is returned.

If no option is provided, or the option is "None" then no additional metadata will be provided, the fuction works like getHilltopData, but allows multiple sites and or measurements to be provided.

If the option is "WQ" then water quality sample metadata will be provided in the output where it is available.

If the option is "Standard" then the quality code information for standard (continuous) is provided with the data.

Note: Currently if measurements of mixed types are requested then only one type of metadata can be associated with the results (ie Water Quality, or Continuous). If both types are required with full metadata then seperate requests will be required.

Value

dataframe of measurements with optional metadata for requested sites.


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