Retrieves an .rds file from the configured public Google cloud storage using
an exact prefix match, downloads it locally, reads it into R, and deletes the
temporary local file. The function also attaches a data_last_updated
attribute parsed from the object filename (expected to contain a timestamp as
the 4th underscore-separated token in %Y%m%d%H%M format).
Value
The R object read from the RDS file, with an extra attribute
data_last_updated (POSIXlt) indicating the timestamp extracted from the filename.
Details
Requires configuration from read_config(). Uses coasts::cloud_object_name() to
resolve the object name and coasts::download_cloud_file() to download it. Assumes
filenames follow a convention like ..._<timestamp>_... where <timestamp>
is in %Y%m%d%H%M format and located at position 4 after splitting on _.
Examples
if (FALSE) { # \dontrun{
x <- get_file("timor_aggregated")
attr(x, "data_last_updated")
} # }