get_aquarius_report_data() returns a report for user-specified timeseries datasets and date range. The function also provides arguments for the inclusion of simplified timeseries dataset names. TODO: Once Envirodata API is updated to return UtcOffset info, will return timeseries as UTC

get_aquarius_report_data(
  start_date,
  end_date,
  timeseries_names,
  make_nice_names,
  includeGapMarkers = FALSE
)

Arguments

start_date

A character string indicating the lower end of the date range. Must be formatted as e.g., 2012-Jan-05.

end_date

A character string indicating the upper end of the date range. Must be formatted as e.g., 2012-Jan-05.

timeseries_names

A character string or vector or list of strings of timeseries names matching those used by EnviroData.

Users may define timeseries names themselves, but are advised to use the LocationIdentifier column from return values of get_aquarius_location_details.

make_nice_names

A logical value. If TRUE will return the column NiceTimeSeriesNames containing simplified timeseries dataset names.

includeGapMarkers

A logical value. Default to FALSE. If TRUE will return NA and a timestamp for each gap period.

Value

A long-format dataframe of Aquarius timeseries data containing the following columns:

  • Location - Names of station names specified by the user.

  • TimeSeriesName - Names of timeseries datasets found in the tenant, matching those specified by the user.

  • DateTime - Date and time the sample was taken. Automatically converted to POSIXct format and assigned the timezone of the user's computer.

  • Value - The lab result associated with each unique record.

  • Unit - The units associated with the lab result for each unique record.

  • Grade - TODO: Add description.

  • ApprovalLevel - TODO: Add description.

  • NiceTimeSeriesNames - Simplified timeseries dataset names presented in snake_case and excluding special characters.

Important events and metadata about calls of get_aquarius_report_data() are documented by the EnviroDataR logger in the log file edr_logs.txt. More information about the EnviroDataR logger can be found in vignette("envirodatar_request_logger").

Examples

# Create basic timeseries data report
start_date <- "2012-01-27"
end_date <- "2016-04-16"
timeseries_names <- "Water Temperature (°C)" # single dataset
timeseries_names <- c("Water Temperature (°C)",
                      "Wind Speed Average (m/s)") # multiple datasets from vector
timeseries_names <- as.list(c("Water Temperature (°C)",
                              "Wind Speed Average (m/s)")) # multiple datasets from list

aq_report_data <- get_aquarius_report_data(
start_date = start_date,
end_date = end_date,
timeseries_names=timeseries_names,
make_nice_names = TRUE)

# Obtain dataset names from 'get_aquarius_location_details()'
start_date <- "2012-01-27"
end_date <- "2016-04-16"

continuous_site_data <- get_aquarius_locations_list()
stations_of_interest <- continuous_site_data$LocationIdentifier
continuous_station_details <- get_aquarius_location_details(stations_of_interest)
timeseries_names <- continuous_station_details$DataSetIdentifer

aq_report_data <- get_aquarius_report_data(
start_date = start_date,
end_date = end_date,
timeseries_names = timeseries_names,
make_nice_names = TRUE)