This function downloads the SHARK codes Excel file from SMHI (if not already cached)
and reads it into R. The file is stored in a persistent cache directory
so it does not need to be downloaded again in subsequent sessions.
A tibble containing the contents of the requested sheet.
Arguments
url
Character string with the URL to the SHARK codes Excel file.
Defaults to the official SMHI codelist.
sheet
Sheet to read. Can be either the sheet name or its index
(default is 1).
skip
Number of rows to skip before reading data
(default is 1, to skip the header row).
force
Logical; if TRUE, forces re-download of the Excel file
even if a cached copy is available. Default is FALSE.
clean_cache_days
Numeric; if not NULL, cached SHARK code Excel files older than
this number of days will be automatically deleted. Defaults to 30. Set to NULL
to disable automatic cleanup.
See Also
clean_shark4r_cache() to manually clear cached files.
# \donttest{# Read the first sheet, skipping the first row codes <- get_shark_codes()
head(codes)
# Force re-download of the Excel file codes <- get_shark_codes(force = TRUE)
# }