fes_get_data: Access to the tables in the FES database

View source: R/lfcFES.R

fes_get_dataR Documentation

Access to the tables in the FES database

Description

fes_get_data is a wrapper for the $get_data method of lfcFES objects. See also fes.

Usage

fes_get_data(object, table_name, spatial = FALSE)

Arguments

object

lfcFES object, as created by fes

table_name

character vector of lenght 1 indicating the requested table name

spatial

logical indicating if the data must be converted to an spatial object

Details

Connection to database can be slow. Tables retrieved from the db are stored in a temporary cache inside the lfcFES object created by fes, making subsequent calls to the same table are faster.

Value

A tbl object: tbl_df if spatial is FALSE, sf if spatial is TRUE

See Also

Other FES functions: fes_avail_tables(), fes_describe_var(), fes()

Examples

if (interactive()) {
  fesdb <- fes()
  # tibble
  fes_get_data(fesdb, 'static')
  # sf tibble
  fes_get_data(fesdb, 'static', TRUE)

  # we can use pipes
  fesdb |>
    fes_get_data('static', TRUE)

  # fesdb is an R6 object, so the previous examples are the same as:
  fesdb$get_data('static')
  fesdb$get_data('static', TRUE)
}


MalditoBarbudo/lfcdata documentation built on May 2, 2023, 10:30 p.m.