Skip to content

Commit 2ead2b7

Browse files
committed
bumping version number
1 parent e8d340f commit 2ead2b7

15 files changed

+233
-13
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cbsodataR
22
Type: Package
33
Title: Statistics Netherlands (CBS) Open Data API Client
4-
Version: 1.1
4+
Version: 1.2.9000
55
Authors@R: c(person("Edwin", "de Jonge", email="edwindjonge@gmail.com", role = c("aut","cre")),
66
person("Sara", "Houweling", role=c("ctb")))
77
Description: The data and meta data from Statistics

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# cbsodataR 1.2.0
2+
3+
* Added options to change the `API` and `BULK` urls, thanks to Hans Vreeken
4+
15
# cbsodataR 1.1.0
26

37
* Added `cbs_add_unit_column` to add unit columns to the data set, thanks to Marieke Rensman en Martin van Elp for the suggestion

R/cbs_download_data.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
#' @param show_progress show a progress bar while downloading.
1313
#' @param select optional names of columns to be returned.
1414
#' @param base_url optionally specify a different server. Useful for
15-
#' third party data services implementing the same protocol.
15+
#' third party data services implementing the same protocol. See details.
16+
#' @inheritSection cbsodataR-package Specify different server
1617
#' @family download
1718
#' @family data retrieval
1819
#' @export
@@ -41,7 +42,7 @@ cbs_download_data <- function( id
4142
base_url <- get_base_url(catalog, base_url)
4243
url <- whisker.render("{{BASEURL}}/{{BULK}}/{{id}}/{{DATASET}}?$format=json"
4344
, list( BASEURL = base_url
44-
, BULK = BULK
45+
, BULK = getOption("cbsodataR.BULK", BULK)
4546
, id = id
4647
, DATASET = DATASET
4748
)

R/cbs_download_meta.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
#' @param cache Should meta data be cached?
1010
#' @return meta data object
1111
#' @param base_url optionally allow to specify a different server. Useful for
12-
#' third party data services implementing the same protocol.
12+
#' third party data services implementing the same protocol, see details.
1313
#' @family meta data
1414
#' @family download
15+
#' @inheritSection cbsodataR-package Specify different server
1516
#' @export
1617
cbs_download_meta <- function( id
1718
, dir=id

R/cbs_get_data.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
#' @param verbose Print extra messages what is happening.
4040
#' @param include_ID Should the data include the ID column for the rows?
4141
#' @param base_url optionally specify a different server. Useful for
42-
#' third party data services implementing the same protocol.
42+
#' third party data services implementing the same protocol, see details.
43+
#' @inheritSection cbsodataR-package Specify different server
4344
#' @return `data.frame` with the requested data. Note that a csv copy of
4445
#' the data is stored in `dir`.
4546
#' @export

R/cbs_get_meta.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cbs_get_meta <- function( id
4040
base_url <- get_base_url(catalog, base_url)
4141
url <- whisker.render("{{BASEURL}}/{{API}}/{{id}}"
4242
, list( BASEURL = base_url
43-
, API = API
43+
, API = getOption("cbsodataR.API", API)
4444
, id = id
4545
)
4646
)

R/cbsopendata.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@
4545
#' - [cbs_join_sf_with_data()], returns an sf object joined with cbs table
4646
#' - [cbs_get_sf()], returns an sf object without data, e.g. "gemeente_2020".
4747
#'
48+
#' @section Specify different server:
49+
#'
50+
#' Besides the official CBS data, there are also third party and preview dataservices
51+
#' implementing the same protocol. The `base_url` parameter allows to specify a different server.
52+
#' The `base_url` can either be specified explicitly or set globally with with
53+
#' `options(cbsodataR.base_url = "http://example.com")`.
54+
#' Some further tweaking may be necessary for third party services, a download url
55+
#' is constructed using: either with:
56+
#'
57+
#' - `<base_url>/<BULK>/<id>/...` for data
58+
#' - `<base_url>/<API>/<id>/?$format=json` for metadata
59+
#'
60+
#' Default values for `BASEURL`, `BULK` and `API` are set in the package options,
61+
#' but can be changed with:
62+
#'
63+
#' ```
64+
#' options(
65+
#' cbsodataR.base_url = "https://opendata.cbs.nl",
66+
#' cbsodataR.BULK = "ODataFeed/odata",
67+
#' cbsodataR.API = "ODataAPI/odata"
68+
#' )
69+
#' ```
70+
#' which are the default values set in the package.
71+
#'
4872
#' @section Copyright use:
4973
#' The content of CBS opendata is subject to Creative Commons Attribution (CC BY 4.0).
5074
#' This means that the re-use of the content is permitted, provided Statistics

R/get-meta.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ get_meta <- function( id
1212
.Deprecated("cbs_get_meta")
1313
url <- whisker.render("{{BASEURL}}/{{API}}/{{id}}"
1414
, list( BASEURL = base_url
15-
, API = API
15+
, API = getOption("cbsodataR.API", API)
1616
, id = id
1717
)
1818
)

man/cbs_download_data.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cbs_download_meta.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cbs_get_data.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cbsodataR-package.Rd

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/download_data-deprecated.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/download_meta-deprecated.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_data-deprecated.Rd

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)