get_data: Get data

Description Usage Arguments Details Value Examples

View source: R/get_data.R

Description

Get the data of the last millesime of all the datafiles found in data. All columns are returned as chr (see below).

Usage

1
get_data(data, query = list(), col_types = cols(.default = "c"), concat = TRUE)

Arguments

data

a tibble issued from datafiles() or a dataframe with two columns ridandmillesime'.

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 cols(.default = "c")

concat

TRUE

Details

You can use convert() to convert number and integer.

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.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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"))

nbc/didor documentation built on Dec. 22, 2021, 12:04 a.m.