convert
convert.Rd
Try to convert columns according to types sended by the API.
Arguments
- data
a dataframe returned by
get_data()
Details
CAUTION For private life reason, data returns by DiDo are secretize (the value is replaced by the string "secret") so readr can't determine data type.
All secret
values will be transform to NA
You can find column's type with columns()
Examples
datafiles() %>%
dido_search("6c79805c-def9-4695-9d9f-7d86599c4d8a") %>%
get_data() %>%
convert()
#> ℹ downloading data and caching to : /tmp/RtmpF5CYw6/6c79805c-def9-4695-9d9f-7d86599c4d8a-2022-10.csv
#>
Downloading: 340 B
Downloading: 340 B
Downloading: 1.3 kB
Downloading: 1.3 kB
Downloading: 1.3 kB
Downloading: 1.3 kB
#> # A tibble: 55 × 10
#> DEPARTEMENT_CODE DEPARTEMENT_LIBELLE REGION_CODE REGION_LIBELLE ANNEE
#> <chr> <chr> <chr> <chr> <chr>
#> 1 971 Guadeloupe 01 Guadeloupe 2021
#> 2 972 Martinique 02 Martinique 2021
#> 3 973 Guyane 03 Guyane 2021
#> 4 974 La Réunion 04 La Réunion 2021
#> 5 976 Mayotte 06 Mayotte 2021
#> 6 971 Guadeloupe 01 Guadeloupe 2020
#> 7 972 Martinique 02 Martinique 2020
#> 8 973 Guyane 03 Guyane 2020
#> 9 974 La Réunion 04 La Réunion 2020
#> 10 976 Mayotte 06 Mayotte 2020
#> # ℹ 45 more rows
#> # ℹ 5 more variables: ESSENCE_M3 <dbl>, GAZOLE_M3 <dbl>, FIOUL_M3 <dbl>,
#> # GPL_M3 <dbl>, CARBUREACTEUR_M3 <dbl>