Skip to contents

Iterates over a vector of station codes and retrieves coordinates using smn_int_extract_coordinates(). If extraction fails for any station, the row is filled with NA values and a warning is emitted.

Usage

smn_info_extract_coordinates(stations, show_progress = interactive(), ...)

Arguments

stations

Character or numeric vector of station codes.

show_progress

Logical. Show a text progress bar when interactive (default interactive()).

...

Optional arguments passed to smn_int_extract_coordinates(), e.g. max_attempts, encoding, add_meta_cols = TRUE.

Value

A base data.frame with columns: station, latitude, longitude, altitude. If you pass add_meta_cols = TRUE in ..., extra columns from smn_int_extract_coordinates() (e.g. source_url) are included too.

Examples

if (FALSE) { # \dontrun{
stations <- c(15020, 15171, 12345)  # 12345 likely fails
coords_df <- smn_info_extract_coordinates(stations)
head(coords_df)
} # }