Download and parse the dataset available at Open Data Jawa Barat into R. This function will download multiple datasets which have same group_id.

jabr_fetch_group(group_id, keep_title = TRUE, as = "table")

Arguments

group_id

The group id of dataset. It only accepts single group id.

keep_title

Whether to keep the dataset title in result. If the result is a table, the title is saved in "title" column. If the result is a list, the title is saved as list name.

as

If as = "table", the fetched datasets will be saved in "dataset" column with list-column type where you can run tidyr::unnest() afterwards. Otherwise the fetched datasets will be saved as list.

Value

A tibble or list of tibble.

Examples

# \donttest{ library(jabr) (x <- jabr_list_dataset())
#> # A tibble: 1,516 x 6 #> id group_id title provider last_modified url #> <chr> <chr> <chr> <chr> <date> <chr> #> 1 9fe01… 5f1a32c2 Jumlah Kepala Ke… Dinas Kepen… 2019-12-16 https://data.ja… #> 2 67304… 0241c181 Jumlah Jaringan … Dinas Komun… 2019-10-23 https://data.ja… #> 3 d3c36… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 4 f9957… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 5 db602… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 6 cfd19… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 7 f90fb… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 8 ff53e… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 9 be7af… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> 10 4c272… ffa4dc21 Angka Harapan Hi… Badan Pusat… 2019-09-25 https://data.ja… #> # … with 1,506 more rows
# for example, we want to fetch data about gini ratio in west java since 2011 to 2017. # The group_id of this data is "78358b54". jabr_fetch_group("78358b54") %>% tidyr::unnest(cols = c(dataset))
#> # A tibble: 189 x 6 #> title provinsi kode_kota_kabup… nama_kota_kabup… gini_ratio satuan #> <chr> <chr> <int> <chr> <dbl> <chr> #> 1 Gini Ratio Di … JAWA BAR… 3204 KAB. BANDUNG 0.357 POIN #> 2 Gini Ratio Di … JAWA BAR… 3217 KAB. BANDUNG BA… 0.285 POIN #> 3 Gini Ratio Di … JAWA BAR… 3216 KAB. BEKASI 0.325 POIN #> 4 Gini Ratio Di … JAWA BAR… 3201 KAB. BOGOR 0.414 POIN #> 5 Gini Ratio Di … JAWA BAR… 3207 KAB. CIAMIS 0.312 POIN #> 6 Gini Ratio Di … JAWA BAR… 3203 KAB. CIANJUR 0.293 POIN #> 7 Gini Ratio Di … JAWA BAR… 3209 KAB. CIREBON 0.273 POIN #> 8 Gini Ratio Di … JAWA BAR… 3205 KAB. GARUT 0.297 POIN #> 9 Gini Ratio Di … JAWA BAR… 3212 KAB. INDRAMAYU 0.28 POIN #> 10 Gini Ratio Di … JAWA BAR… 3215 KAB. KARAWANG 0.328 POIN #> # … with 179 more rows
# }