dbpf_observations_stats: Return statistics about observations in DB

View source: R/dbpf_observations_stats.R

dbpf_observations_statsR Documentation

Return statistics about observations in DB

Description

Provides mean min max and count for a certain period and one or several locations.

Usage

dbpf_observations_stats(
  con,
  location_name,
  unit_of_measurement = "C",
  time_b = "2015-09-01 00:00:00+00",
  time_e = "2016-08-31 23:59:59+00",
  verbose = FALSE
)

Arguments

con

Database connection object, as returned by dbpf_con()

location_name

Character string or list of several with the location name(s) to be queried for.

unit_of_measurement

Unit of measurments, defaults to "C"

time_b

Begin time for the interval to be analysed. Use the format "1950-01-01 00:00:00+00"

time_e

End time for the interval to be analysed. Use the format "1950-01-01 00:00:00+00"

verbose

Provide terminal output of the query string? (defaults to FALSE)

Details

These simple functions return all data as data frames. When making a query many times, optimise the SQL statement to only request the data you actually need.

Value

Data frame with locations in rows and columns loc_name, height, max, min, avg, cnt

Author(s)

Stephan Gruber <stephan.gruber@carleton.ca>

Examples

## Not run: 
con <- dbpf_con()
stat <- dbpf_observations_stats(con, "NGO-RC-163")
dbDisconnect(con)

## End(Not run)

geocryology/PermafrostDB documentation built on April 17, 2025, 11:54 a.m.