Checks the CSO PxStat API for a list of all the table codes (e.g. A0101, A0102, A0103, etc.), which also includes date last modified and title for each table, and returns this list as an R data frame.
cso_get_toc(
cache = TRUE,
suppress_messages = FALSE,
get_frequency = FALSE,
list_vars = FALSE,
flush_cache = TRUE,
from_date = lubridate::date(lubridate::today() - lubridate::years(2))
)data frame of three character columns:
id. Contains all of the table codes currently available on the CSO API.
LastModified. The date the table was last modified in POSIXct format.
title. The title of the table.
logical. If TRUE (default) the table of contents is cached with the system date as a key.
logical. If FALSE (default) a message is printed when loading a previously cached table of contents.
logical. If TRUE the frequency of each table(yearly, monthly etc...) will be returned as an additional column in the table of contents.
logical. If TRUE an additional column will be added to the table of contents which lists each tables variables.
logical. If TRUE (default) the cache will be checked for old, unused files. Any files which have not been accessed in the last month will be deleted.
date in the format YYYY-MM-DD or Null. Will only return tables last modified after date provided. Default is 2 years from current date.
The data is pulled from the ReadCollection on the CSO API. See https://github.com/CSOIreland/PxStat/wiki/API-Cube-RESTful for more information on this.
if (FALSE) {
head(cso_get_toc())
}
Run the code above in your browser using DataLab