Skip to content

Commit

Permalink
bumping version number
Browse files Browse the repository at this point in the history
  • Loading branch information
edwindj committed Oct 11, 2024
1 parent e8d340f commit 2ead2b7
Show file tree
Hide file tree
Showing 15 changed files with 233 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: cbsodataR
Type: Package
Title: Statistics Netherlands (CBS) Open Data API Client
Version: 1.1
Version: 1.2.9000
Authors@R: c(person("Edwin", "de Jonge", email="[email protected]", role = c("aut","cre")),
person("Sara", "Houweling", role=c("ctb")))
Description: The data and meta data from Statistics
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# cbsodataR 1.2.0

* Added options to change the `API` and `BULK` urls, thanks to Hans Vreeken

# cbsodataR 1.1.0

* Added `cbs_add_unit_column` to add unit columns to the data set, thanks to Marieke Rensman en Martin van Elp for the suggestion
Expand Down
5 changes: 3 additions & 2 deletions R/cbs_download_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#' @param show_progress show a progress bar while downloading.
#' @param select optional names of columns to be returned.
#' @param base_url optionally specify a different server. Useful for
#' third party data services implementing the same protocol.
#' third party data services implementing the same protocol. See details.
#' @inheritSection cbsodataR-package Specify different server
#' @family download
#' @family data retrieval
#' @export
Expand Down Expand Up @@ -41,7 +42,7 @@ cbs_download_data <- function( id
base_url <- get_base_url(catalog, base_url)
url <- whisker.render("{{BASEURL}}/{{BULK}}/{{id}}/{{DATASET}}?$format=json"
, list( BASEURL = base_url
, BULK = BULK
, BULK = getOption("cbsodataR.BULK", BULK)
, id = id
, DATASET = DATASET
)
Expand Down
3 changes: 2 additions & 1 deletion R/cbs_download_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#' @param cache Should meta data be cached?
#' @return meta data object
#' @param base_url optionally allow to specify a different server. Useful for
#' third party data services implementing the same protocol.
#' third party data services implementing the same protocol, see details.
#' @family meta data
#' @family download
#' @inheritSection cbsodataR-package Specify different server
#' @export
cbs_download_meta <- function( id
, dir=id
Expand Down
3 changes: 2 additions & 1 deletion R/cbs_get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#' @param verbose Print extra messages what is happening.
#' @param include_ID Should the data include the ID column for the rows?
#' @param base_url optionally specify a different server. Useful for
#' third party data services implementing the same protocol.
#' third party data services implementing the same protocol, see details.
#' @inheritSection cbsodataR-package Specify different server
#' @return `data.frame` with the requested data. Note that a csv copy of
#' the data is stored in `dir`.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/cbs_get_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cbs_get_meta <- function( id
base_url <- get_base_url(catalog, base_url)
url <- whisker.render("{{BASEURL}}/{{API}}/{{id}}"
, list( BASEURL = base_url
, API = API
, API = getOption("cbsodataR.API", API)
, id = id
)
)
Expand Down
24 changes: 24 additions & 0 deletions R/cbsopendata.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@
#' - [cbs_join_sf_with_data()], returns an sf object joined with cbs table
#' - [cbs_get_sf()], returns an sf object without data, e.g. "gemeente_2020".
#'
#' @section Specify different server:
#'
#' Besides the official CBS data, there are also third party and preview dataservices
#' implementing the same protocol. The `base_url` parameter allows to specify a different server.
#' The `base_url` can either be specified explicitly or set globally with with
#' `options(cbsodataR.base_url = "http://example.com")`.
#' Some further tweaking may be necessary for third party services, a download url
#' is constructed using: either with:
#'
#' - `<base_url>/<BULK>/<id>/...` for data
#' - `<base_url>/<API>/<id>/?$format=json` for metadata
#'
#' Default values for `BASEURL`, `BULK` and `API` are set in the package options,
#' but can be changed with:
#'
#' ```
#' options(
#' cbsodataR.base_url = "https://opendata.cbs.nl",
#' cbsodataR.BULK = "ODataFeed/odata",
#' cbsodataR.API = "ODataAPI/odata"
#' )
#' ```
#' which are the default values set in the package.
#'
#' @section Copyright use:
#' The content of CBS opendata is subject to Creative Commons Attribution (CC BY 4.0).
#' This means that the re-use of the content is permitted, provided Statistics
Expand Down
2 changes: 1 addition & 1 deletion R/get-meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get_meta <- function( id
.Deprecated("cbs_get_meta")
url <- whisker.render("{{BASEURL}}/{{API}}/{{id}}"
, list( BASEURL = base_url
, API = API
, API = getOption("cbsodataR.API", API)
, id = id
)
)
Expand Down
29 changes: 28 additions & 1 deletion man/cbs_download_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion man/cbs_download_meta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion man/cbs_get_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions man/cbsodataR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion man/download_data-deprecated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion man/download_meta-deprecated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion man/get_data-deprecated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ead2b7

Please sign in to comment.