R/read_abs_local.R
read_abs_local.RdIf you need to download and tidy time series data from the ABS,
use read_abs(). read_abs_local() imports and tidies data
from ABS time series spreadsheets that are already saved to your local drive.
read_abs_local(
cat_no = NULL,
filenames = NULL,
path = Sys.getenv("R_READABS_PATH", unset = tempdir()),
use_fst = TRUE,
metadata = TRUE
)character; a single catalogue number such as "6202.0".
When cat_no is specified, all local files in path corresponding to
the specified catalogue number will be imported.
For example, if you run read_abs_local("6202.0"), it will look in
the 6202.0 sub-folder of path and attempt to load any
.xls and .xlsx files in that location.
If cat_no`` is specified, filenames` will be ignored.
character vector of at least one filename of a
locally-stored ABS time series spreadsheet. For example, "6202001.xls" or
c("6202001.xls", "6202005.xls"). Ignored if a value is supplied to cat_no.
If filenames is blank and cat_no is blank, read_abs_local() will
attempt to read all .xls and .xlsx files in the directory specified with path.
path to local directory containing ABS time series file(s).
Default is Sys.getenv("R_READABS_PATH", unset = tempdir()).
If nothing is specified in filenames or cat_no,
read_abs_local() will attempt to read all .xls and .xlsx files in the directory
specified with path.
logical. If TRUE (the default) then, if an fst file of the
tidy data frame has already been saved in path, it is read immediately.
logical. If TRUE (the default), a tidy data frame including
ABS metadata (series name, table name, etc.) is included in the output. If
FALSE, metadata is dropped.
Unlike read_abs(), the table_title column in the data frame
returned by read_abs_local() is blank. If you require table_title,
please use read_abs() instead.
# Load and tidy two specified files from the "data/ABS" subdirectory
# of your working directory
if (FALSE) { # \dontrun{
lfs <- read_abs_local(c("6202001.xls", "6202005.xls"))
} # }