Do a GET call to PXWEB API and return a data.frame
Usage
pxweb_get_data(
url,
query,
verbose = TRUE,
column.name.type = "text",
variable.value.type = "text"
)
Arguments
- url
a
pxweb
object or url that can be coherced to apxweb
object.- query
a json string, json file or list object that can be coherced to a
pxweb_query
object.- verbose
should large queries print out progress.
- column.name.type
character: should
code
ortext
be used as column names?- variable.value.type
character: should
code
ortext
be used as values in columns?
Details
The functions use will do a pxweb_query
to a PXWEB url
and return a data.frame
.
This is a wrapper for the pxweb_get
function.
See also
See pxweb_get
for mor general usage and pxweb_query
for details on PXWEB queries.
Examples
if (FALSE) {
url <- "https://api.scb.se/OV0104/v1/doris/sv/ssd/BE/BE0101/BE0101A/BefolkningNy"
query <- file.path(
system.file(package = "pxweb"),
"extdata", "examples", "json_query_example.json"
)
df <- pxweb_get_data(url = url, query = query)
}