diff --git a/DESCRIPTION b/DESCRIPTION index a4e7dbf1..79fa4138 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: pxweb Title: R Interface to PXWEB APIs Version: 0.16.3 -Date: 2024-01-14 +Date: 2024-01-13 Authors@R: c( person("Mans", "Magnusson", , "mons.magnusson@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0296-2719")), diff --git a/NAMESPACE b/NAMESPACE index 6ac471ca..7fc69632 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -15,6 +15,10 @@ S3method(print,pxweb_levels) S3method(print,pxweb_metadata) S3method(print,pxweb_query) S3method(pxweb_api_catalogue_entry,list) +S3method(pxweb_as_data_frame,pxweb_data) +S3method(pxweb_as_data_frame,pxweb_data_comment) +S3method(pxweb_as_data_frame,pxweb_data_comments) +S3method(pxweb_as_data_frame,pxweb_levels) S3method(pxweb_data_comments,pxweb_data) S3method(pxweb_query,character) S3method(pxweb_query,json) @@ -38,6 +42,7 @@ export(pxweb_advanced_get) export(pxweb_api) export(pxweb_api_catalogue) export(pxweb_api_catalogue_path) +export(pxweb_as_data_frame) export(pxweb_cite) export(pxweb_data_comments) export(pxweb_get) diff --git a/R/pxweb_as_data_frame.R b/R/pxweb_as_data_frame.R index ff84871a..f1d0172a 100644 --- a/R/pxweb_as_data_frame.R +++ b/R/pxweb_as_data_frame.R @@ -10,7 +10,7 @@ #' #' @seealso \code{\link[base]{as.data.frame}}. #' -#' @keywords internal +#' @export pxweb_as_data_frame <- function(x, row.names = NULL, optional = FALSE, ..., stringsAsFactors = FALSE, column.name.type = "text", variable.value.type = "text") { checkmate::assert_choice(column.name.type, c("code", "text")) checkmate::assert_choice(column.name.type, c("code", "text")) @@ -18,7 +18,7 @@ pxweb_as_data_frame <- function(x, row.names = NULL, optional = FALSE, ..., stri } #' @rdname pxweb_as_data_frame -#' @keywords internal +#' @export pxweb_as_data_frame.pxweb_data <- function(x, row.names = NULL, optional = FALSE, ..., stringsAsFactors = FALSE, column.name.type = "text", variable.value.type = "text") { pxdims <- pxweb_data_dim(x) checkmate::assert_character(row.names, len = pxdims[1], null.ok = TRUE) @@ -45,7 +45,7 @@ pxweb_as_data_frame.pxweb_data <- function(x, row.names = NULL, optional = FALSE } #' @rdname pxweb_as_data_frame -#' @keywords internal +#' @export pxweb_as_data_frame.pxweb_data_comments <- function(x, optional = FALSE, ..., stringsAsFactors = FALSE) { checkmate::assert_flag(optional) checkmate::assert_flag(stringsAsFactors) @@ -72,7 +72,7 @@ pxweb_as_data_frame.pxweb_data_comments <- function(x, optional = FALSE, ..., st } #' @rdname pxweb_as_data_frame -#' @keywords internal +#' @export pxweb_as_data_frame.pxweb_data_comment <- function(x, optional = FALSE, ..., stringsAsFactors = FALSE) { checkmate::assert_flag(optional) checkmate::assert_flag(stringsAsFactors) @@ -92,7 +92,7 @@ pxweb_as_data_frame.pxweb_data_comment <- function(x, optional = FALSE, ..., str #' @rdname pxweb_as_data_frame -#' @keywords internal +#' @export pxweb_as_data_frame.pxweb_levels <- function(x, optional = FALSE, ..., stringsAsFactors = FALSE) { checkmate::assert_flag(optional) checkmate::assert_flag(stringsAsFactors) diff --git a/inst/CITATION b/inst/CITATION index 7409cef9..3c37c3ba 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,8 +1,8 @@ citHeader("Kindly cite the pxweb R package as follows:") -citEntry(entry="misc", +bibentry(bibtype="misc", title = "pxweb: R tools for PX-WEB API", - author = personList( + author = c( person(given = "Mans", family= "Magnusson", email = "mons.magnusson@gmail.com"), person(given = "Markus", family= "Kainu"), person(given = "Janne", family= "Huovari"), diff --git a/vignettes/pxweb.Rmd b/vignettes/pxweb.Rmd index 42b8e42f..56af0781 100644 --- a/vignettes/pxweb.Rmd +++ b/vignettes/pxweb.Rmd @@ -13,7 +13,7 @@ vignette: > This R package provides tools to access [PX-WEB -API](https://pxnet2.stat.fi/API-description_SCB.pdf). Your +API](https://www.scb.se/en/services/open-data-api/api-for-the-statistical-database/). Your [contributions](https://ropengov.org/community/) and [bug reports and other feedback](https://github.com/ropengov/pxweb) are welcome! @@ -30,8 +30,8 @@ The `pxweb` R package connects any PXWEB API to R and facilitates the access, us [A number of organizations](https://www.scb.se/en/services/statistical-programs-for-px-files/px-web/pxweb-examples/) use PXWEB to distribute hierarchical data. You can browse the available data sets at: - * [Statistics Sweden](http://www.statistikdatabasen.scb.se/pxweb/en/ssd/) with [API Description](https://pxnet2.stat.fi/API-description_SCB.pdf) - * [Statistics Finland](https://tilastokeskus.fi/til/aihealuejako.html) [StatFi API Description](https://pxnet2.stat.fi/api1.html) + * [Statistics Sweden](http://www.statistikdatabasen.scb.se/pxweb/en/ssd/) with [API Description](https://www.scb.se/en/services/open-data-api/api-for-the-statistical-database/) + * [Statistics Finland](https://tilastokeskus.fi/til/aihealuejako.html) [StatFi API Description](https://statfin.stat.fi/api1.html) * [Other organizations using PX-WEB](https://www.scb.se/en/services/statistical-programs-for-px-files/px-web/pxweb-examples/) ### About PXWEB APIs diff --git a/vignettes/pxweb.html b/vignettes/pxweb.html index b4a5a5e2..10a3fc78 100644 --- a/vignettes/pxweb.html +++ b/vignettes/pxweb.html @@ -240,7 +240,7 @@ background-color: #f7f7f7; border-radius: 3px; color: #333; -white-space: pre-wrap; +white-space: pre-wrap; } pre { border-radius: 3px; @@ -308,18 +308,18 @@ a[href^="https:"] { text-decoration: underline; } -code > span.kw { color: #555; font-weight: bold; } -code > span.dt { color: #902000; } -code > span.dv { color: #40a070; } -code > span.bn { color: #d14; } -code > span.fl { color: #d14; } -code > span.ch { color: #d14; } -code > span.st { color: #d14; } -code > span.co { color: #888888; font-style: italic; } -code > span.ot { color: #007020; } -code > span.al { color: #ff0000; font-weight: bold; } -code > span.fu { color: #900; font-weight: bold; } -code > span.er { color: #a61717; background-color: #e3d2d2; } +code > span.kw { color: #555; font-weight: bold; } +code > span.dt { color: #902000; } +code > span.dv { color: #40a070; } +code > span.bn { color: #d14; } +code > span.fl { color: #d14; } +code > span.ch { color: #d14; } +code > span.st { color: #d14; } +code > span.co { color: #888888; font-style: italic; } +code > span.ot { color: #007020; } +code > span.al { color: #ff0000; font-weight: bold; } +code > span.fu { color: #900; font-weight: bold; } +code > span.er { color: #a61717; background-color: #e3d2d2; } @@ -369,7 +369,7 @@

2022-10-31

-

This R package provides tools to access PX-WEB API. +

This R package provides tools to access PX-WEB API. Your contributions and bug reports and other feedback are welcome!

We can find more information on the PX-Web/PC-Axis API here.

@@ -389,10 +389,10 @@

Available data sources and tools

You can browse the available data sets at: