Main functions for searching and retrieving tables

twstats_get_table(required_name)
    twstats_find_tables(
        required_columns = NULL,
        required_rowcount = NULL,
        previous_tables = c())

Arguments

required_name

Name of the table you want to read, e.g. 'eurostat/tin00073/country:BE'

required_columns

Column types your table should have, wildcards allowed, e.g. 'year/*/value'

required_rowcount

Approximate power-of-ten rows the returned tables should have, e.g. 10, 100, 1000.

previous_tables

Character vector of already-known tables, filtered from results, e.g. c('eurostat/tin00073/country:BE', 'eurostat/tin00073/country:UK').

Details

Find and retrieve data from twstats.

Value

twstats_get_table returns a twstats_table object, or an error if nothing can be found.

twstats_find_tables returns a character vector of all matching table names.

Examples

# NOT RUN {
# Find all tables with per-country data
table_names <- twstats_find_tables('country/value')

# Get a twstats table, extract the title and data
tbl <- twstats_get_table('eurostat/tin00073/country:BE')
title <- tbl$title
df <- tbl$data()
# }