Generic function to access data from tables and views in Atlas database
db_read_table.Rd
Return data objects stored in tables and views in the Atlas database.
Usage
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 eitherpublic
,api
,public_api
, oratlas_api
.- output_geometry
Optional.
logical
defaultFALSE
. IfTRUE
, returns ansf
object using thegeometry
column from the table.- output_flatten
logical
defaultTRUE
. IfTRUE
, returns adata.frame
object with nested objects flattened.- limit
Optional.
integer
defaultNULL
. Maximum number of rows to return. IfNULL
, all rows are returned. From the PostgREST API syntax.- select
Optional.
character
defaultNULL
. List of columns to return. All columns are returned ifNULL
. From the PostgREST API syntax.- ...
Additional parameters to be passed as query to the API table_name.
- .cores
Optional.
integer
default4
. Number of cores to use for parallel processing. If1
, no parallel processing is used. IfNULL
, 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
defaultNULL
. Number of pages to download. ' IfNULL
, the number of pages is estimated from the number of rows in the table.- .page_limit
Optional.
integer
default500000
. Maximum number of rows to download per page. This parameter is used to estimate the number of pages to download if.n_pages
isNULL
.