All Projects → edwindj → cbsodataR

edwindj / cbsodataR

Licence: other
Statistics Netherlands (CBS) OpenData API Client for R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to cbsodataR

nomisr
Access UK official statistics from the Nomis database through R.
Stars: ✭ 30 (+11.11%)
Mutual labels:  census-data, officialstatistics
websegura
Analizamos y mostramos seguridad HTTPS de sitios web públicos, como medida para visualizar aquellos que pueden suponer un riesgo para sus usuarios.
Stars: ✭ 27 (+0%)
Mutual labels:  opendata
Opendata
CRAN OpenData Task View
Stars: ✭ 188 (+596.3%)
Mutual labels:  opendata
awesome-json-next
A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More
Stars: ✭ 50 (+85.19%)
Mutual labels:  opendata
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+9659.26%)
Mutual labels:  opendata
ods
Open Data Service - Make consuming open data easy, safe, and reliable
Stars: ✭ 35 (+29.63%)
Mutual labels:  opendata
Dados Abertos
Repositório do serviço de Dados Abertos da Câmara. Consulte as "Issues" para atendimento a dúvidas e sugestões.
Stars: ✭ 153 (+466.67%)
Mutual labels:  opendata
covid19-time-series-utilities
several utilities to help wrangle COVID-19 data into a time-series format
Stars: ✭ 34 (+25.93%)
Mutual labels:  opendata
SemanticWikibase
Makes Wikibase data available in Semantic MediaWiki
Stars: ✭ 14 (-48.15%)
Mutual labels:  opendata
dkan2
Deprecated: please use the 2.x branch of the dkan repo
Stars: ✭ 17 (-37.04%)
Mutual labels:  opendata
euro
Free open public domain football data (euro.db) for Euro 2008, Euro 2012, Euro 2016, Euro 2020 (2021), etc.
Stars: ✭ 38 (+40.74%)
Mutual labels:  opendata
Pynasa
Stars: ✭ 212 (+685.19%)
Mutual labels:  opendata
swiss-hospital-data
Data on hospital infrastructure in Switzerland
Stars: ✭ 19 (-29.63%)
Mutual labels:  opendata
Sport.db
sport.db - open sports database (e.g. football.db, formula1.db etc.) command line tool and libraries
Stars: ✭ 202 (+648.15%)
Mutual labels:  opendata
worldcup
Free open public domain football data for the World Cup (incl. Qatar 2022, Russia 2018, Brazil 2014, etc.) and World Cup Quali(fiers)
Stars: ✭ 530 (+1862.96%)
Mutual labels:  opendata
Udata
Customizable and skinnable social platform dedicated to open data.
Stars: ✭ 181 (+570.37%)
Mutual labels:  opendata
covid-france
Visualize evolution of the number of people hospitalized in French departments due to COVID-19 infection
Stars: ✭ 23 (-14.81%)
Mutual labels:  opendata
wqcloud
腾讯云Node.js Open API SDK(完整版)
Stars: ✭ 16 (-40.74%)
Mutual labels:  cbs
tweetyourmep
TweetyourMEP
Stars: ✭ 17 (-37.04%)
Mutual labels:  opendata
qsv
CSVs sliced, diced & analyzed.
Stars: ✭ 438 (+1522.22%)
Mutual labels:  opendata

Statistics Netherlands (www.cbs.nl) opendata API client for R

version downloads R build status AppVeyor Build Status

Retrieve data from the open data interface (dutch) of Statistics Netherlands (cbs.nl) with R.

Note for Windows 7/8 users

The security of the CBS web service has been updated, if you experience problems, you can try the following:

Sys.setenv(CURL_SSL_BACKEND = "openssl")
options("url.method" = "libcurl")

toc <- cbs_get_toc()
View(toc)

Installation

From CRAN

install.packages("cbsodataR")

The latest development version of cbsodata can installed using devtools.

devtools::install_github("edwindj/cbsodataR")

Usage (version 0.3+)

Retrieve a table of contents with all SN tables.

library(cbsodataR)
ds <- cbs_get_datasets("Language" = "en")
head(ds)
## # A tibble: 6 x 25
##   Updated             Identifier Title   ShortTitle  ShortDescription   Summary 
##   <dttm>              <chr>      <chr>   <chr>       <chr>              <chr>   
## 1 2021-03-19 00:00:00 80783eng   Agricu… Agricultur… "\nThis table con… "Agricu…
## 2 2021-03-19 00:00:00 80784eng   Agricu… Agricultur… "\nThis table con… "Agricu…
## 3 2021-03-31 00:00:00 7100eng    Arable… Arable cro… "\nThis table pro… "Area a…
## 4 2019-04-12 00:00:00 70671ENG   Fruit … Fruit cult… "\nThis table pro… "Cultiv…
## 5 2021-03-31 00:00:00 37738ENG   Vegeta… Vegetables… "\nThis table pro… "Area a…
## 6 2021-02-15 00:00:00 83981ENG   Livest… Livestock … "\nThis table com… "Manure…
## # … with 19 more variables: Modified <dttm>, MetaDataModified <dttm>,
## #   ReasonDelivery <chr>, ExplanatoryText <chr>, OutputStatus <chr>,
## #   Source <chr>, Language <chr>, Catalog <chr>, Frequency <chr>, Period <chr>,
## #   SummaryAndLinks <chr>, ApiUrl <chr>, FeedUrl <chr>,
## #   DefaultPresentation <chr>, DefaultSelection <chr>, GraphTypes <chr>,
## #   RecordCount <int>, ColumnCount <int>, SearchPriority <chr>

or do a search:

res <- cbs_search("apple", language="en")
res[1:3, c(1:4)]
## # A tibble: 3 x 4
##   score Updated             Identifier Title                                    
##   <dbl> <dttm>              <chr>      <chr>                                    
## 1 16.0  2019-04-12 00:00:00 71509ENG   Yield and cultivation area apples and pe…
## 2 10.3  2019-04-12 00:00:00 70671ENG   Fruit culture; area fruit orchards, sort…
## 3  1.42 2015-05-22 00:00:00 81894ENG   Health accounts; providers and financing…

Use the Identifier from tables to retrieve table information

cbs_get_meta('71509ENG')
## 71509ENG: 'Yield apples and pears, 1997 - 2017', 2017
##   FruitFarmingRegions: 'Fruit farming regions'
##   Periods: 'Periods' 
## 
## Retrieve a default data selection with:
##  cbs_get_data(id = "71509ENG", FruitFarmingRegions = c("1", "2", 
## "4", "3", "5"), Periods = c("1997JJ00", "2012JJ00", "2013JJ00", 
## "2016JJ00"), select = c("FruitFarmingRegions", "Periods", "TotalAppleVarieties_1", 
## "CoxSOrangePippin_2", "DelbarestivaleDelcorf_3", "Elstar_4", 
## "GoldenDelicious_5", "Jonagold_6", "Jonagored_7", "RodeBoskoopRennetApple_10", 
## "OtherAppleVarieties_12", "TotalPearVarieties_13", "Conference_15", 
## "DoyenneDuComice_16", "CookingPears_17", "TriompheDeVienne_18", 
## "OtherPearVarieties_19", "TotalAppleVarieties_20", "CoxSOrangePippin_21", 
## "DelbarestivaleDelcorf_22", "Elstar_23", "GoldenDelicious_24", 
## "Jonagold_25", "Jonagored_26", "RodeBoskoopRennetApple_29", "OtherAppleVarieties_31", 
## "TotalPearVarieties_32", "Conference_34", "DoyenneDuComice_35", 
## "CookingPears_36", "TriompheDeVienne_37", "OtherPearVarieties_38"
## ))

Or download data.

library(dplyr) # just for example's sake
apples <- cbs_get_data("71509ENG") 

apples %>% 
  select(1:4)
## # A tibble: 105 x 4
##    FruitFarmingRegions Periods  TotalAppleVarieties_1 CoxSOrangePippin_2
##    <chr>               <chr>                    <int>              <int>
##  1 1                   1997JJ00                   420                 43
##  2 1                   1998JJ00                   518                 40
##  3 1                   1999JJ00                   568                 39
##  4 1                   2000JJ00                   461                 27
##  5 1                   2001JJ00                   408                 30
##  6 1                   2002JJ00                   354                 17
##  7 1                   2003JJ00                   359                 17
##  8 1                   2004JJ00                   436                 14
##  9 1                   2005JJ00                   359                 12
## 10 1                   2006JJ00                   365                 11
## # … with 95 more rows

add label columns:

apples %>% 
  cbs_add_label_columns() %>% 
  select(1:4)
## # A tibble: 105 x 4
##    FruitFarmingRegions FruitFarmingRegions_label Periods  Periods_label
##    <chr>               <fct>                     <chr>    <fct>        
##  1 1                   Total Netherlands         1997JJ00 1997         
##  2 1                   Total Netherlands         1998JJ00 1998         
##  3 1                   Total Netherlands         1999JJ00 1999         
##  4 1                   Total Netherlands         2000JJ00 2000         
##  5 1                   Total Netherlands         2001JJ00 2001         
##  6 1                   Total Netherlands         2002JJ00 2002         
##  7 1                   Total Netherlands         2003JJ00 2003         
##  8 1                   Total Netherlands         2004JJ00 2004         
##  9 1                   Total Netherlands         2005JJ00 2005         
## 10 1                   Total Netherlands         2006JJ00 2006         
## # … with 95 more rows

For more information, see vignette("cbsodataR")

Python user? Use cbsodata.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].