get_data | R Documentation |
Get the data of the last millesime of all the datafiles found in data. All columns are returned as chr
(see below).
For private life reason, data returned by DiDo can be secretize (the value is
replaced by the string "secret") so readr can't determine data type. You can
use convert()
to convert number and integer.
get_data cache data before loading it. By default it saves the files
in tempdir()
. If you downloaded the same data again, il will first try to
find it in the cache
argument. If you want to cache data between
session, don't keep the default but use your own directory.
get_data(
data,
query = list(),
col_types = cols(.default = "c"),
concat = TRUE,
cache = tempdir()
)
data |
a tibble issued from |
query |
a query to pass to the API to select columns and filter on values. |
col_types |
how to convert columns, the default is to use char for all
columns |
concat |
|
cache |
the directory to cache/save downloaded files. Default is |
For caching, get_data()
will use a reproductible name compose of the
datafile identifier (rid) and the stringification of the query passed to
get_data()
of a query is passed.
If concat is TRUE
(default), return a tibble with all data concatenated in
one tibble.
If concat is FALSE
, return a list of tibbles.
get_data()
returns only chr columns. Use convert
to convert columns to good types.
# get all columns
datafiles() %>%
dido_search("drom") %>%
get_data()
# get only DEPARTEMENT_CODE and ESSENCE_M3 columns
datafiles() %>%
dido_search("drom") %>%
get_data(query = c(columns = "DEPARTEMENT_CODE,ESSENCE_M3"))
# get only rows where `DEPARTEMENT_CODE == 971
datafiles() %>%
dido_search("drom") %>%
get_data(query = c(DEPARTEMENT_CODE = "eq:971"))
datafiles() %>%
dido_search("drom") %>%
get_data(query = c(DEPARTEMENT_CODE = "eq:971"), cache = tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.