inmet_get: Download and read INMET data in one call

View source: R/get.R

inmet_getR Documentation

Download and read INMET data in one call

Description

This is the recommended high-level interface. It downloads missing annual archives, reuses valid cached files, and returns the result of inmet_read().

Usage

inmet_get(
  years,
  stations = NULL,
  dest_dir = tools::R_user_dir("rmet", "cache"),
  tz = "UTC",
  variables = NULL,
  start_date = NULL,
  end_date = NULL,
  max_tries = 15L,
  force = FALSE,
  quiet = FALSE
)

Arguments

years

Integer vector of years.

stations

Optional station codes. Matching is case-insensitive.

dest_dir

Directory containing ⁠<year>.zip⁠ archives.

tz

Output time zone. Defaults to "UTC", the time standard used in the source files. Any name in OlsonNames() is accepted.

variables

Optional meteorological columns to retain.

start_date, end_date

Optional inclusive date limits in YYYY-MM-DD format, interpreted in tz.

max_tries

Maximum download attempts per year.

force

Download archives again even if they are valid.

quiet

Suppress progress messages.

Value

A data frame as documented in inmet_read().

Examples


weather <- inmet_get(
  years = 2023,
  stations = "A801",
  variables = c("temp_dry_c", "precip_mm"),
  dest_dir = tempdir()
)


rmet documentation built on Sept. 21, 2026, 5:08 p.m.