Skip to contents

Queries DuckDB for the most recent n observations per station. Returns a tibble suitable for JSON serialisation.

Usage

generate_api_latest(db_path = "inst/extdata/irish_buoys.duckdb", n = 1L)

Arguments

db_path

Character, path to the DuckDB database file (default: "inst/extdata/irish_buoys.duckdb")

n

Integer, number of most recent observations per station to return (default: 1L)

Value

A tibble with n rows per station, ordered by station and time (most recent first).

Examples

if (FALSE) { # \dontrun{
latest <- generate_api_latest(n = 1)
latest_5 <- generate_api_latest(n = 5)
} # }