nfi_get_data | R Documentation |
nfi_get_data
is a wrapper for the $get_data
method
of lfcNFI
objects. See also nfi
.
nfi_get_data(object, table_name, spatial = FALSE)
object |
|
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 |
Connection to database can be slow. Tables retrieved from the db are
stored in a temporary cache inside the lfcNFI object created by
nfi
, making subsequent calls to the same table are faster.
A tbl object: tbl_df if spatial is FALSE
, sf if spatial is
TRUE
Other NFI functions:
nfi_avail_tables()
,
nfi_describe_table()
,
nfi_describe_var()
,
nfi()
if (interactive()) {
nfidb <- nfi()
# tibble
nfi_get_data(nfidb, 'plots')
# sf tibble
nfi_get_data(nfidb, 'plots', TRUE)
# we can use pipes
nfidb |>
nfi_get_data('plots', TRUE)
# nfidb is an R6 object, so the previous examples are the same as:
nfidb$get_data('plots')
nfidb$get_data('plots', TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.