Return data objects stored in tables and views in the Atlas database.

db_read_table(
  table_name,
  schema = "public",
  output_geometry = FALSE,
  output_flatten = TRUE,
  limit = NULL,
  select = NULL,
  ...,
  .cores = 4,
  .n_pages = NULL,
  .page_limit = 10000
)

Arguments

table_name

character. Name of the table to be accessed.

schema

character default 'public'. Schema from the database where the table is located. Can be either public, api, public_api, or atlas_api.

output_geometry

Optional. logical default FALSE. If TRUE, returns an sf object using the geometry column from the table.

output_flatten

logical default TRUE. If TRUE, returns a data.frame object with nested objects flattened.

limit

Optional. integer default NULL. Maximum number of rows to return. If NULL, all rows are returned. From the PostgREST API syntax.

select

Optional. character default NULL. List of columns to return. All columns are returned if NULL. From the PostgREST API syntax.

...

Additional parameters to be passed as query to the API table_name.

.cores

Optional. integer default 4. Number of cores to use for parallel processing. If 1, no parallel processing is used. If NULL, the function will automatically determine the number of cores to use based on the number of available cores on the system.

.n_pages

Optional. integer default NULL. Number of pages to download. ' If NULL, the number of pages is estimated from the number of rows in the table.

.page_limit

Optional. integer default 500000. Maximum number of rows to download per page. This parameter is used to estimate the number of pages to download if .n_pages is NULL.

Value

tibble or sf with rows associated with Atlas data object

Details

This function is designed to interface with a web API deployed with PostgREST.