From fe7210da0a9f86876f9d536ff155a61616501276 Mon Sep 17 00:00:00 2001 From: aleksanderbl29 Date: Wed, 27 Nov 2024 23:16:02 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20rOpenGov?= =?UTF-8?q?/dkstat@ec32754a1ddc80793c804ba8c3b04373941bb895=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 30 ++++++++++++++++++------------ pkgdown.yml | 2 +- reference/dst_find_val_id.html | 13 +++++++------ reference/dst_get_all_data.html | 4 ++-- reference/dst_get_data.html | 7 ++++--- reference/dst_meta.html | 10 +++++----- reference/dst_meta_parse.html | 25 +++++++++++++------------ reference/dst_search.html | 13 +++++++------ search.json | 2 +- 9 files changed, 58 insertions(+), 48 deletions(-) diff --git a/index.html b/index.html index 74d2196..c8d2a29 100644 --- a/index.html +++ b/index.html @@ -244,8 +244,10 @@

Get data

You need to build your query based on the text column that each variable contains in the meta_data$values list.

-aulaar <- dst_get_data(table = "AULAAR", KØN = "Total", PERPCT = "Per cent of the labour force", Tid = 2013,
-                       lang = "en")
+aulaar <- dst_get_data(
+  table = "AULAAR", KØN = "Total", PERPCT = "Per cent of the labour force", Tid = 2013,
+  lang = "en"
+)
 str(aulaar)
## 'data.frame':    1 obs. of  4 variables:
 ##  $ KØN   : chr "Total"
@@ -257,13 +259,15 @@ 

Get data
 folk1a_meta <- dst_meta("folk1a", lang = "da")
 
-str(dst_get_data(table = "folk1a",
-                 Tid = "*",
-                 CIVILSTAND = "*",
-                 ALDER = "*",
-                 OMRÅDE = c("Hele landet", "København", "Dragør", "Albertslund"),
-                 lang = "da", 
-                 meta_data = folk1a_meta))

+str(dst_get_data( + table = "folk1a", + Tid = "*", + CIVILSTAND = "*", + ALDER = "*", + OMRÅDE = c("Hele landet", "København", "Dragør", "Albertslund"), + lang = "da", + meta_data = folk1a_meta +))
## 'data.frame':    172720 obs. of  5 variables:
 ##  $ TID       : POSIXct, format: "2008-01-01" "2008-01-01" ...
 ##  $ CIVILSTAND: chr  "I alt" "I alt" "I alt" "I alt" ...
@@ -273,9 +277,11 @@ 

Get dataI can also build a query beforehand and then use the query in the query parameter. This might be a good way to split your script up into smaller pieces and make it more structured.

You might have noticed that I use the * as a value in the TID variable. You can use the star as a alternative to writing all the text values for the variable.

-my_query <- list(OMRÅDE = c("Hele landet", "København", "Frederiksberg", "Odense"),
-                 CIVILSTAND = "Ugift",
-                 TID = "*")
+my_query <- list(
+  OMRÅDE = c("Hele landet", "København", "Frederiksberg", "Odense"),
+  CIVILSTAND = "Ugift",
+  TID = "*"
+)
 
 str(dst_get_data(table = "folk1a", query = my_query, lang = "da"))
## 'data.frame':    272 obs. of  4 variables:
diff --git a/pkgdown.yml b/pkgdown.yml
index edad279..9b90e5f 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,7 +2,7 @@ pandoc: 3.1.11
 pkgdown: 2.1.1
 pkgdown_sha: ~
 articles: {}
-last_built: 2024-11-27T22:59Z
+last_built: 2024-11-27T23:15Z
 urls:
   reference: https://ropengov.github.io/dkstat/reference
   article: https://ropengov.github.io/dkstat/articles
diff --git a/reference/dst_find_val_id.html b/reference/dst_find_val_id.html
index ca9bf33..a34839e 100644
--- a/reference/dst_find_val_id.html
+++ b/reference/dst_find_val_id.html
@@ -1,7 +1,7 @@
 
-This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id • dkstat
+This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id • dkstat
     Skip to contents
 
 
@@ -34,8 +34,8 @@
     
-

This is a helper function to extract the ID's in the values list -that the dst_meta function returns.

+

This is a helper function to extract the ID's in the values list that the +dst_meta function returns.

@@ -56,7 +56,8 @@

Argumentsvalues_text -

Character vector. The values you want to extract the IDs for. If NULL, the returned value will be "*".

+

Character vector. The values you want to extract the IDs +for. If NULL, the returned value will be "*".

diff --git a/reference/dst_get_all_data.html b/reference/dst_get_all_data.html index 8d035b9..624dddb 100644 --- a/reference/dst_get_all_data.html +++ b/reference/dst_get_all_data.html @@ -68,8 +68,8 @@

Argumentsparse_dst_tid -

Logical. Default is TRUE. The date will be the first -day of the period and the time zone is "UTC" and not the Danish "CET".

+

Logical. Default is TRUE. The date will be the first day +of the period and the time zone is "UTC" and not the Danish "CET".

diff --git a/reference/dst_get_data.html b/reference/dst_get_data.html index fec19a0..19d5096 100644 --- a/reference/dst_get_data.html +++ b/reference/dst_get_data.html @@ -66,8 +66,8 @@

Argumentsparse_dst_tid -

Logical. Default is TRUE. The date will be the first -day of the period and the time zone is "UTC" and not the Danish "CET".

+

Logical. Default is TRUE. The date will be the first day +of the period and the time zone is "UTC" and not the Danish "CET".

lang
@@ -75,7 +75,8 @@

Argumentsmeta_data -

Meta data for the table. If NULL the meta data will be requested.

+

Meta data for the table. If NULL the meta data will be +requested.

format
diff --git a/reference/dst_meta.html b/reference/dst_meta.html index 12b5d91..d8654f5 100644 --- a/reference/dst_meta.html +++ b/reference/dst_meta.html @@ -1,7 +1,7 @@ -This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta • dkstat +This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta • dkstat Skip to contents @@ -34,8 +34,8 @@

-

This function POSTs a request for meta data on a table from Statistics Denmark -and returns a JSON object with the information.

+

This function POSTs a request for meta data on a table from Statistics +Denmark and returns a JSON object with the information.

diff --git a/reference/dst_meta_parse.html b/reference/dst_meta_parse.html index 5833ce1..5773461 100644 --- a/reference/dst_meta_parse.html +++ b/reference/dst_meta_parse.html @@ -1,11 +1,11 @@ -This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse • dkstat +This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse • dkstat Skip to contents @@ -38,10 +38,10 @@
-

This function structures the JSON data a bit an creates a basic_query. -Some tables are VERY large, so the basic request is rather simple. The -function returns a list with basic data, info on available variables -and a list with a basic request.

+

This function structures the JSON data a bit an creates a basic_query. Some +tables are VERY large, so the basic request is rather simple. The function +returns a list with basic data, info on available variables and a list with a +basic request.

@@ -58,7 +58,8 @@

Argumentslang -

The language from the orignal dst_meta function (due to an error in the API)

+

The language from the orignal dst_meta function (due to an error +in the API)

diff --git a/reference/dst_search.html b/reference/dst_search.html index bf2f6b9..4efef68 100644 --- a/reference/dst_search.html +++ b/reference/dst_search.html @@ -1,7 +1,7 @@ -This function provides a search function for the description field of available data series — dst_search • dkstat +This function provides a search function for the description field of available data series — dst_search • dkstat Skip to contents @@ -34,8 +34,8 @@
-

This function provides a search function for the description field of available -data series

+

This function provides a search function for the description field of +available data series

@@ -60,7 +60,8 @@

Argumentsuse_cache -

A logical scalar. Should the function call Statbank or use a (possibly outdated) saved version of their tables?

+

A logical scalar. Should the function call Statbank or use a +(possibly outdated) saved version of their tables?

diff --git a/search.json b/search.json index 06f375c..63dc619 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://ropengov.github.io/dkstat/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Aleksander Bang-Larsen. Author, maintainer. Kenneth Rose. Author. Thomas J. leeper. Contributor.","code":""},{"path":"https://ropengov.github.io/dkstat/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kenneth Rose (2024). dkstat: API connection StatBank Statistics Denmark. R package version 0.09.","code":"@Manual{, title = {dkstat: API connection to the StatBank from Statistics Denmark}, author = {Kenneth Rose}, year = {2024}, note = {R package version 0.09}, }"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/index.html","id":"dkstat-","dir":"","previous_headings":"","what":"dkstat","title":"API connection to the StatBank from Statistics Denmark","text":"package connects StatBank API Statistics Denmark. package early BETA new changes likely backward compatibility.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"a-short-message-in-danish","dir":"","previous_headings":"","what":"A short message in Danish","title":"API connection to the StatBank from Statistics Denmark","text":"Denne R Statistics pakke indeholder funktioner til give dig adgang til data gennem API’en fra Danmarks Statistik. Funktionerne henter data fra Statistikbanken og retunerer data.frame objekter med værdierne du spørger efter dit funktionskald.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"API connection to the StatBank from Statistics Denmark","text":"can install development version github, using Hadley Wickham’s devtools package:","code":"if(!require(\"devtools\")) install.packages(\"devtools\") library(\"devtools\") install_github(\"rOpenGov/dkstat\")"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"API connection to the StatBank from Statistics Denmark","text":"default language danish, got lang parameter can change “da” “en” wan’t data returned English.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"four-basic-function","dir":"","previous_headings":"Examples","what":"Four basic function","title":"API connection to the StatBank from Statistics Denmark","text":"four basic functions learn: dst_search() function makes possible search different tables word phrase. dst_tables() function downloads possible tables available. dst_meta() function lets download meta data specific table, can see description, unit, variables values can download data . dst_get_data() lets download actual data wan’t. simple examples go basics requesting data StatBank structure output. First, ’ll load package:","code":"library(dkstat)"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"the-search-function","dir":"","previous_headings":"","what":"The search function","title":"API connection to the StatBank from Statistics Denmark","text":"search function let’s .. OK, might know already. search gdp text field tables.","code":"dst_search(string = \"bnp\", field = \"text\") ## id ## 584 NAN1 ## 588 NKN1 ## 593 NAHL2 ## 596 NKHO2 ## 599 NAHO2 ## 602 NAHD21 ## 669 NRHP ## 670 VNRHP ## 1318 CFABNP ## text ## 584 Forsyningsbalance, bruttonationalprodukt (BNP),økonomisk vækst, beskæftigelse mv. ## 588 Forsyningsbalance, Bruttonationalprodukt (BNP), beskæftigelse mv. ## 593 1-2.1.1 Produktion, BNP og indkomstdannelse (hovedposter) ## 596 1-2.1.1 Produktion, BNP og indkomstdannelse ## 599 1-2.1.1 Produktion, BNP og indkomstdannelse (oversigt) ## 602 1 Produktion og BNP (detaljeret) ## 669 1-2.1.1 Produktion, BNP og indkomstdannelse ## 670 Versionstabel NRHP - Produktion, BNP og indkomstdannelse ## 1318 FoU udgifter i pct. af BNP ## unit updated firstPeriod latestPeriod active ## 584 - 2024-10-03T08:00:00 1966 2023 TRUE ## 588 - 2024-11-20T08:00:00 1990K1 2024K3 TRUE ## 593 Mio. kr. 2024-06-28T08:00:00 1966 2023 TRUE ## 596 Mio. kr. 2024-11-20T08:00:00 1990K1 2024K3 TRUE ## 599 Mio. kr. 2024-06-28T08:00:00 1995 2023 TRUE ## 602 Mio. kr. 2024-06-28T08:00:00 1995 2023 TRUE ## 669 - 2024-10-28T08:00:00 1993 2023 TRUE ## 670 - 2024-10-28T08:00:00 1993 2023 TRUE ## 1318 Pct. af bnp 2023-12-14T08:00:00 1997 2022 TRUE ## variables ## 584 transaktion, prisenhed, tid ## 588 transaktion, prisenhed, sæsonkorrigering, tid ## 593 transaktion, prisenhed, tid ## 596 transaktion, prisenhed, sæsonkorrigering, tid ## 599 transaktion, prisenhed, tid ## 602 transaktion, prisenhed, tid ## 669 område, transaktion, prisenhed, tid ## 670 version, område, transaktion, prisenhed, tid ## 1318 pct af BNP, tid"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"download-the-tables","dir":"","previous_headings":"","what":"Download the tables","title":"API connection to the StatBank from Statistics Denmark","text":"dst_get_tables function downloads available tables search function use searching word phrase.","code":"head(dst_get_tables(lang = \"da\")) ## id text unit updated ## 1 FOLK1A Befolkningen den 1. i kvartalet Antal 2024-11-11T08:00:00 ## 2 FOLK1AM Befolkningen den 1. i måneden Antal 2024-11-11T08:00:00 ## 3 BEFOLK1 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 4 BEFOLK2 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 5 FOLK3 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 6 FOLK3FOD Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## firstPeriod latestPeriod active variables ## 1 2008K1 2024K4 TRUE område,køn,alder,civilstand,tid ## 2 2021M10 2024M10 TRUE område,køn,alder,tid ## 3 1971 2024 TRUE køn,alder,civilstand,tid ## 4 1901 2024 TRUE køn,alder,tid ## 5 2008 2024 TRUE fødselsdag,fødselsmåned,fødselsår,tid ## 6 2008 2024 TRUE fødselsdag,fødselsmåned,fødeland,tid"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"meta-data","dir":"","previous_headings":"","what":"Meta data","title":"API connection to the StatBank from Statistics Denmark","text":"dst_meta function retrieves meta data table wan’t take closer look . can used create final request, can figure structure query can define . ’ll get meta data AULAAR table. AULAAR table net unemployment numbers. ‘dst_meta’ function returns list 4 objects: - basics - variables - values - basic_query","code":"aulaar_meta <- dst_meta(table = \"AULAAR\", lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"basics","dir":"","previous_headings":"Meta data","what":"Basics","title":"API connection to the StatBank from Statistics Denmark","text":"Let’s see basics contains: ’s table id, short description, unit description table updated.","code":"aulaar_meta$basics ## $id ## [1] \"AULAAR\" ## ## $text ## [1] \"Fuldtidsledige (netto)\" ## ## $description ## [1] \"Fuldtidsledige (netto) efter køn, personer/pct. og tid\" ## ## $unit ## [1] \"Antal\" ## ## $updated ## [1] \"2024-04-16T08:00:00\" ## ## $footnote ## NULL"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"variables","dir":"","previous_headings":"Meta data","what":"Variables","title":"API connection to the StatBank from Statistics Denmark","text":"variables list short description variable well id. might want make sure supplied ID’s elimination columns equal FALSE. IDs eliminnation equal FALSE mandatory.","code":"aulaar_meta$variables ## id text elimination ## 1 KØN køn TRUE ## 2 PERPCT personer/pct. FALSE ## 3 Tid tid FALSE"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"values","dir":"","previous_headings":"Meta data","what":"Values","title":"API connection to the StatBank from Statistics Denmark","text":"values list object values variable. use text column construct final query:","code":"str(aulaar_meta$values) ## List of 3 ## $ KØN :'data.frame': 3 obs. of 2 variables: ## ..$ id : chr [1:3] \"TOT\" \"M\" \"K\" ## ..$ text: chr [1:3] \"I alt\" \"Mænd\" \"Kvinder\" ## $ PERPCT:'data.frame': 2 obs. of 2 variables: ## ..$ id : chr [1:2] \"L10\" \"L9\" ## ..$ text: chr [1:2] \"Procent af arbejdsstyrken\" \"Ledige (1000 personer)\" ## $ Tid :'data.frame': 45 obs. of 2 variables: ## ..$ id : chr [1:45] \"1979\" \"1980\" \"1981\" \"1982\" ... ## ..$ text: chr [1:45] \"1979\" \"1980\" \"1981\" \"1982\" ..."},{"path":"https://ropengov.github.io/dkstat/index.html","id":"get-data","dir":"","previous_headings":"","what":"Get data","title":"API connection to the StatBank from Statistics Denmark","text":"need build query based text column variable contains meta_data$values list. request don’t supply meta_data dst_get_data function, possible show . ’s good idea supply meta data dst_get_data function query table . don’t supply meta data dst_get_data function request meta data table ineffecient. Let’s query statbank using one value variable. can also build query beforehand use query query parameter. might good way split script smaller pieces make structured. might noticed use * value TID variable. can use star alternative writing text values variable. run problems, try set parse_dst_tid parameter FALSE datasets non-standard date formats. Don’t hesitate submit issue question github ’ll try help much can.","code":"aulaar <- dst_get_data(table = \"AULAAR\", KØN = \"Total\", PERPCT = \"Per cent of the labour force\", Tid = 2013, lang = \"en\") str(aulaar) ## 'data.frame': 1 obs. of 4 variables: ## $ KØN : chr \"Total\" ## $ PERPCT: chr \"Per cent of the labour force\" ## $ TID : POSIXct, format: \"2013-01-01\" ## $ value : num 4.4 folk1a_meta <- dst_meta(\"folk1a\", lang = \"da\") str(dst_get_data(table = \"folk1a\", Tid = \"*\", CIVILSTAND = \"*\", ALDER = \"*\", OMRÅDE = c(\"Hele landet\", \"København\", \"Dragør\", \"Albertslund\"), lang = \"da\", meta_data = folk1a_meta)) ## 'data.frame': 172720 obs. of 5 variables: ## $ TID : POSIXct, format: \"2008-01-01\" \"2008-01-01\" ... ## $ CIVILSTAND: chr \"I alt\" \"I alt\" \"I alt\" \"I alt\" ... ## $ ALDER : chr \"Alder i alt\" \"Alder i alt\" \"Alder i alt\" \"Alder i alt\" ... ## $ OMRÅDE : chr \"Hele landet\" \"København\" \"Dragør\" \"Albertslund\" ... ## $ value : int 5475791 509861 13261 27602 64412 7986 121 295 65722 7097 ... my_query <- list(OMRÅDE = c(\"Hele landet\", \"København\", \"Frederiksberg\", \"Odense\"), CIVILSTAND = \"Ugift\", TID = \"*\") str(dst_get_data(table = \"folk1a\", query = my_query, lang = \"da\")) ## 'data.frame': 272 obs. of 4 variables: ## $ OMRÅDE : chr \"Hele landet\" \"Hele landet\" \"Hele landet\" \"Hele landet\" ... ## $ CIVILSTAND: chr \"Ugift\" \"Ugift\" \"Ugift\" \"Ugift\" ... ## $ TID : POSIXct, format: \"2008-01-01\" \"2008-04-01\" ... ## $ value : int 2552700 2563134 2564705 2568255 2575185 2584993 2584560 2588198 2593172 2604129 ... str(dst_get_data(table = \"AUP01\", OMRÅDE = c(\"Hele landet\"), TID = \"*\", lang = \"da\")) ## 'data.frame': 87 obs. of 3 variables: ## $ OMRÅDE: chr \"Hele landet\" \"Hele landet\" \"Hele landet\" \"Hele landet\" ... ## $ TID : POSIXct, format: \"2017-07-01\" \"2017-08-01\" ... ## $ value : num 4 4.1 3.9 4 4 4.1 4.2 4.2 4.1 3.7 ..."},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":null,"dir":"Reference","previous_headings":"","what":"Corrects url encoding for Danish letters. — dst_correct_url","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"Corrects url encoding Danish letters.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"","code":"dst_correct_url(url)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"url build url.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to parse the dates from the statbank. — dst_date_parse","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"Helper function parse dates statbank.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"","code":"dst_date_parse(dst_date)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"dst_date vector length one date formats like 1982M12D09, 1982M12, 1982Q4 1982","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"Returns input date formatted Europe/Copenhagen","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":null,"dir":"Reference","previous_headings":"","what":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"helper function extract ID's values list dst_meta function returns.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"","code":"dst_find_val_id(meta_data, variable, values_text = NULL)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"meta_data meta data object. variable variable search . values_text Character vector. values want extract IDs . NULL, returned value \"*\".","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"Get data table StatBank. function provides query parameters user's behalf. , user, need specify anything table name given entire contents table nice long format. useful , like filter table e.g. {dplyr} functions save entire table archival.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"","code":"dst_get_all_data(table, lang = \"da\", parse_dst_tid = TRUE)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"table Table StatBank. lang language. \"en\" english \"da\" danish. parse_dst_tid Logical. Default TRUE. date first day period time zone \"UTC\" Danish \"CET\".","code":""},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"Aleksander Bang-Larsen contact@aleksanderbl.dk","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"Get data table StatBank.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"","code":"dst_get_data( table, ..., query = NULL, parse_dst_tid = TRUE, lang = \"da\", meta_data = NULL, format = \"CSV\", value_presentation = \"Value\" )"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"table Table StatBank. ... Build query. query list object query. parse_dst_tid Logical. Default TRUE. date first day period time zone \"UTC\" Danish \"CET\". lang language. \"en\" english \"da\" danish. meta_data Meta data table. NULL meta data requested. format character value. \"CSV\" \"BULK\". choose BULK need select value parameters. value_presentation now, \"value\" \"default\"","code":""},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":null,"dir":"Reference","previous_headings":"","what":"This functions downloads all the available tables. — dst_get_tables","title":"This functions downloads all the available tables. — dst_get_tables","text":"functions downloads available tables.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This functions downloads all the available tables. — dst_get_tables","text":"","code":"dst_get_tables(lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This functions downloads all the available tables. — dst_get_tables","text":"lang \"da\" (danish) \"en\" (english)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"function POSTs request meta data table Statistics Denmark returns JSON object information.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"","code":"dst_meta(table, ..., lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"table name table want meta data . ... Ignored. lang can choose \"en\" english \"da\" danish.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"function structures JSON data bit creates basic_query. tables large, basic request rather simple. function returns list basic data, info available variables list basic request.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"","code":"dst_meta_parse(meta, lang)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"meta returned meta data function meta_dst. lang language orignal dst_meta function (due error API)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to return ids based on text values — dst_query_match","title":"Helper function to return ids based on text values — dst_query_match","text":"helper function return ids based text values.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to return ids based on text values — dst_query_match","text":"","code":"dst_query_match(table, lang, meta_data, query, format)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to return ids based on text values — dst_query_match","text":"table Table StatBank. lang language. \"en\" english \"da\" danish. meta_data meta data object extract values query query match format Format specify match csv import (used)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":null,"dir":"Reference","previous_headings":"","what":"This function provides a search function for the description field of available data series — dst_search","title":"This function provides a search function for the description field of available data series — dst_search","text":"function provides search function description field available data series","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function provides a search function for the description field of available data series — dst_search","text":"","code":"dst_search(string = \"gpd\", field = \"text\", lang = \"da\", use_cache = NULL)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function provides a search function for the description field of available data series — dst_search","text":"string Character string. Speficies search term. field Character string. lang Character. \"da\" danish \"en\" english. use_cache logical scalar. function call Statbank use (possibly outdated) saved version tables?","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":null,"dir":"Reference","previous_headings":"","what":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"helper function returns number values call return. API limit 100.000 values.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"","code":"dst_value_limit(query, dst_meta)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"query Query object analyse dst_meta Meta data filer query ","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":null,"dir":"Reference","previous_headings":"","what":"Cached list of all available tables with danish names and descriptions — tables_da","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"Cached list available tables danish names descriptions","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"","code":"tables_da"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":"tables-da","dir":"Reference","previous_headings":"","what":"tables_da","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"data frame 2339 rows 8 columns: id Unique ID table text Description table unit unit values represented table updated table last updated firstPeriod time first observation table latestPeriod time latest observation table active Binary indicator table active variables List variables table","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":null,"dir":"Reference","previous_headings":"","what":"Cached list of all available tables — tables_en","title":"Cached list of all available tables — tables_en","text":"Cached list available tables","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cached list of all available tables — tables_en","text":"","code":"tables_en"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":"tables-en","dir":"Reference","previous_headings":"","what":"tables_en","title":"Cached list of all available tables — tables_en","text":"data frame 2339 rows 8 columns: id Unique ID table text Description table unit unit values represented table updated table last updated firstPeriod time first observation table latestPeriod time latest observation table active Binary indicator table active variables List variables table","code":""}] +[{"path":"https://ropengov.github.io/dkstat/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Aleksander Bang-Larsen. Author, maintainer. Kenneth Rose. Author. Thomas J. leeper. Contributor.","code":""},{"path":"https://ropengov.github.io/dkstat/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kenneth Rose (2024). dkstat: API connection StatBank Statistics Denmark. R package version 0.09.","code":"@Manual{, title = {dkstat: API connection to the StatBank from Statistics Denmark}, author = {Kenneth Rose}, year = {2024}, note = {R package version 0.09}, }"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/index.html","id":"dkstat-","dir":"","previous_headings":"","what":"dkstat","title":"API connection to the StatBank from Statistics Denmark","text":"package connects StatBank API Statistics Denmark. package early BETA new changes likely backward compatibility.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"a-short-message-in-danish","dir":"","previous_headings":"","what":"A short message in Danish","title":"API connection to the StatBank from Statistics Denmark","text":"Denne R Statistics pakke indeholder funktioner til give dig adgang til data gennem API’en fra Danmarks Statistik. Funktionerne henter data fra Statistikbanken og retunerer data.frame objekter med værdierne du spørger efter dit funktionskald.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"API connection to the StatBank from Statistics Denmark","text":"can install development version github, using Hadley Wickham’s devtools package:","code":"if(!require(\"devtools\")) install.packages(\"devtools\") library(\"devtools\") install_github(\"rOpenGov/dkstat\")"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"API connection to the StatBank from Statistics Denmark","text":"default language danish, got lang parameter can change “da” “en” wan’t data returned English.","code":""},{"path":"https://ropengov.github.io/dkstat/index.html","id":"four-basic-function","dir":"","previous_headings":"Examples","what":"Four basic function","title":"API connection to the StatBank from Statistics Denmark","text":"four basic functions learn: dst_search() function makes possible search different tables word phrase. dst_tables() function downloads possible tables available. dst_meta() function lets download meta data specific table, can see description, unit, variables values can download data . dst_get_data() lets download actual data wan’t. simple examples go basics requesting data StatBank structure output. First, ’ll load package:","code":"library(dkstat)"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"the-search-function","dir":"","previous_headings":"","what":"The search function","title":"API connection to the StatBank from Statistics Denmark","text":"search function let’s .. OK, might know already. search gdp text field tables.","code":"dst_search(string = \"bnp\", field = \"text\") ## id ## 584 NAN1 ## 588 NKN1 ## 593 NAHL2 ## 596 NKHO2 ## 599 NAHO2 ## 602 NAHD21 ## 669 NRHP ## 670 VNRHP ## 1318 CFABNP ## text ## 584 Forsyningsbalance, bruttonationalprodukt (BNP),økonomisk vækst, beskæftigelse mv. ## 588 Forsyningsbalance, Bruttonationalprodukt (BNP), beskæftigelse mv. ## 593 1-2.1.1 Produktion, BNP og indkomstdannelse (hovedposter) ## 596 1-2.1.1 Produktion, BNP og indkomstdannelse ## 599 1-2.1.1 Produktion, BNP og indkomstdannelse (oversigt) ## 602 1 Produktion og BNP (detaljeret) ## 669 1-2.1.1 Produktion, BNP og indkomstdannelse ## 670 Versionstabel NRHP - Produktion, BNP og indkomstdannelse ## 1318 FoU udgifter i pct. af BNP ## unit updated firstPeriod latestPeriod active ## 584 - 2024-10-03T08:00:00 1966 2023 TRUE ## 588 - 2024-11-20T08:00:00 1990K1 2024K3 TRUE ## 593 Mio. kr. 2024-06-28T08:00:00 1966 2023 TRUE ## 596 Mio. kr. 2024-11-20T08:00:00 1990K1 2024K3 TRUE ## 599 Mio. kr. 2024-06-28T08:00:00 1995 2023 TRUE ## 602 Mio. kr. 2024-06-28T08:00:00 1995 2023 TRUE ## 669 - 2024-10-28T08:00:00 1993 2023 TRUE ## 670 - 2024-10-28T08:00:00 1993 2023 TRUE ## 1318 Pct. af bnp 2023-12-14T08:00:00 1997 2022 TRUE ## variables ## 584 transaktion, prisenhed, tid ## 588 transaktion, prisenhed, sæsonkorrigering, tid ## 593 transaktion, prisenhed, tid ## 596 transaktion, prisenhed, sæsonkorrigering, tid ## 599 transaktion, prisenhed, tid ## 602 transaktion, prisenhed, tid ## 669 område, transaktion, prisenhed, tid ## 670 version, område, transaktion, prisenhed, tid ## 1318 pct af BNP, tid"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"download-the-tables","dir":"","previous_headings":"","what":"Download the tables","title":"API connection to the StatBank from Statistics Denmark","text":"dst_get_tables function downloads available tables search function use searching word phrase.","code":"head(dst_get_tables(lang = \"da\")) ## id text unit updated ## 1 FOLK1A Befolkningen den 1. i kvartalet Antal 2024-11-11T08:00:00 ## 2 FOLK1AM Befolkningen den 1. i måneden Antal 2024-11-11T08:00:00 ## 3 BEFOLK1 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 4 BEFOLK2 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 5 FOLK3 Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## 6 FOLK3FOD Befolkningen 1. januar Antal 2024-02-12T08:00:00 ## firstPeriod latestPeriod active variables ## 1 2008K1 2024K4 TRUE område,køn,alder,civilstand,tid ## 2 2021M10 2024M10 TRUE område,køn,alder,tid ## 3 1971 2024 TRUE køn,alder,civilstand,tid ## 4 1901 2024 TRUE køn,alder,tid ## 5 2008 2024 TRUE fødselsdag,fødselsmåned,fødselsår,tid ## 6 2008 2024 TRUE fødselsdag,fødselsmåned,fødeland,tid"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"meta-data","dir":"","previous_headings":"","what":"Meta data","title":"API connection to the StatBank from Statistics Denmark","text":"dst_meta function retrieves meta data table wan’t take closer look . can used create final request, can figure structure query can define . ’ll get meta data AULAAR table. AULAAR table net unemployment numbers. ‘dst_meta’ function returns list 4 objects: - basics - variables - values - basic_query","code":"aulaar_meta <- dst_meta(table = \"AULAAR\", lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"basics","dir":"","previous_headings":"Meta data","what":"Basics","title":"API connection to the StatBank from Statistics Denmark","text":"Let’s see basics contains: ’s table id, short description, unit description table updated.","code":"aulaar_meta$basics ## $id ## [1] \"AULAAR\" ## ## $text ## [1] \"Fuldtidsledige (netto)\" ## ## $description ## [1] \"Fuldtidsledige (netto) efter køn, personer/pct. og tid\" ## ## $unit ## [1] \"Antal\" ## ## $updated ## [1] \"2024-04-16T08:00:00\" ## ## $footnote ## NULL"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"variables","dir":"","previous_headings":"Meta data","what":"Variables","title":"API connection to the StatBank from Statistics Denmark","text":"variables list short description variable well id. might want make sure supplied ID’s elimination columns equal FALSE. IDs eliminnation equal FALSE mandatory.","code":"aulaar_meta$variables ## id text elimination ## 1 KØN køn TRUE ## 2 PERPCT personer/pct. FALSE ## 3 Tid tid FALSE"},{"path":"https://ropengov.github.io/dkstat/index.html","id":"values","dir":"","previous_headings":"Meta data","what":"Values","title":"API connection to the StatBank from Statistics Denmark","text":"values list object values variable. use text column construct final query:","code":"str(aulaar_meta$values) ## List of 3 ## $ KØN :'data.frame': 3 obs. of 2 variables: ## ..$ id : chr [1:3] \"TOT\" \"M\" \"K\" ## ..$ text: chr [1:3] \"I alt\" \"Mænd\" \"Kvinder\" ## $ PERPCT:'data.frame': 2 obs. of 2 variables: ## ..$ id : chr [1:2] \"L10\" \"L9\" ## ..$ text: chr [1:2] \"Procent af arbejdsstyrken\" \"Ledige (1000 personer)\" ## $ Tid :'data.frame': 45 obs. of 2 variables: ## ..$ id : chr [1:45] \"1979\" \"1980\" \"1981\" \"1982\" ... ## ..$ text: chr [1:45] \"1979\" \"1980\" \"1981\" \"1982\" ..."},{"path":"https://ropengov.github.io/dkstat/index.html","id":"get-data","dir":"","previous_headings":"","what":"Get data","title":"API connection to the StatBank from Statistics Denmark","text":"need build query based text column variable contains meta_data$values list. request don’t supply meta_data dst_get_data function, possible show . ’s good idea supply meta data dst_get_data function query table . don’t supply meta data dst_get_data function request meta data table ineffecient. Let’s query statbank using one value variable. can also build query beforehand use query query parameter. might good way split script smaller pieces make structured. might noticed use * value TID variable. can use star alternative writing text values variable. run problems, try set parse_dst_tid parameter FALSE datasets non-standard date formats. Don’t hesitate submit issue question github ’ll try help much can.","code":"aulaar <- dst_get_data( table = \"AULAAR\", KØN = \"Total\", PERPCT = \"Per cent of the labour force\", Tid = 2013, lang = \"en\" ) str(aulaar) ## 'data.frame': 1 obs. of 4 variables: ## $ KØN : chr \"Total\" ## $ PERPCT: chr \"Per cent of the labour force\" ## $ TID : POSIXct, format: \"2013-01-01\" ## $ value : num 4.4 folk1a_meta <- dst_meta(\"folk1a\", lang = \"da\") str(dst_get_data( table = \"folk1a\", Tid = \"*\", CIVILSTAND = \"*\", ALDER = \"*\", OMRÅDE = c(\"Hele landet\", \"København\", \"Dragør\", \"Albertslund\"), lang = \"da\", meta_data = folk1a_meta )) ## 'data.frame': 172720 obs. of 5 variables: ## $ TID : POSIXct, format: \"2008-01-01\" \"2008-01-01\" ... ## $ CIVILSTAND: chr \"I alt\" \"I alt\" \"I alt\" \"I alt\" ... ## $ ALDER : chr \"Alder i alt\" \"Alder i alt\" \"Alder i alt\" \"Alder i alt\" ... ## $ OMRÅDE : chr \"Hele landet\" \"København\" \"Dragør\" \"Albertslund\" ... ## $ value : int 5475791 509861 13261 27602 64412 7986 121 295 65722 7097 ... my_query <- list( OMRÅDE = c(\"Hele landet\", \"København\", \"Frederiksberg\", \"Odense\"), CIVILSTAND = \"Ugift\", TID = \"*\" ) str(dst_get_data(table = \"folk1a\", query = my_query, lang = \"da\")) ## 'data.frame': 272 obs. of 4 variables: ## $ OMRÅDE : chr \"Hele landet\" \"Hele landet\" \"Hele landet\" \"Hele landet\" ... ## $ CIVILSTAND: chr \"Ugift\" \"Ugift\" \"Ugift\" \"Ugift\" ... ## $ TID : POSIXct, format: \"2008-01-01\" \"2008-04-01\" ... ## $ value : int 2552700 2563134 2564705 2568255 2575185 2584993 2584560 2588198 2593172 2604129 ... str(dst_get_data(table = \"AUP01\", OMRÅDE = c(\"Hele landet\"), TID = \"*\", lang = \"da\")) ## 'data.frame': 87 obs. of 3 variables: ## $ OMRÅDE: chr \"Hele landet\" \"Hele landet\" \"Hele landet\" \"Hele landet\" ... ## $ TID : POSIXct, format: \"2017-07-01\" \"2017-08-01\" ... ## $ value : num 4 4.1 3.9 4 4 4.1 4.2 4.2 4.1 3.7 ..."},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":null,"dir":"Reference","previous_headings":"","what":"Corrects url encoding for Danish letters. — dst_correct_url","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"Corrects url encoding Danish letters.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"","code":"dst_correct_url(url)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_correct_url.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Corrects url encoding for Danish letters. — dst_correct_url","text":"url build url.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to parse the dates from the statbank. — dst_date_parse","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"Helper function parse dates statbank.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"","code":"dst_date_parse(dst_date)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"dst_date vector length one date formats like 1982M12D09, 1982M12, 1982Q4 1982","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_date_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to parse the dates from the statbank. — dst_date_parse","text":"Returns input date formatted Europe/Copenhagen","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":null,"dir":"Reference","previous_headings":"","what":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"helper function extract ID's values list dst_meta function returns.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"","code":"dst_find_val_id(meta_data, variable, values_text = NULL)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_find_val_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This is a helper function to extract the ID's in the values list that the dst_meta function returns. — dst_find_val_id","text":"meta_data meta data object. variable variable search . values_text Character vector. values want extract IDs . NULL, returned value \"*\".","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"Get data table StatBank. function provides query parameters user's behalf. , user, need specify anything table name given entire contents table nice long format. useful , like filter table e.g. {dplyr} functions save entire table archival.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"","code":"dst_get_all_data(table, lang = \"da\", parse_dst_tid = TRUE)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"table Table StatBank. lang language. \"en\" english \"da\" danish. parse_dst_tid Logical. Default TRUE. date first day period time zone \"UTC\" Danish \"CET\".","code":""},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_all_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"This function returns the entire table requested data from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_all_data","text":"Aleksander Bang-Larsen contact@aleksanderbl.dk","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"Get data table StatBank.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"","code":"dst_get_data( table, ..., query = NULL, parse_dst_tid = TRUE, lang = \"da\", meta_data = NULL, format = \"CSV\", value_presentation = \"Value\" )"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns the requested data from the StatBank table. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_get_data","text":"table Table StatBank. ... Build query. query list object query. parse_dst_tid Logical. Default TRUE. date first day period time zone \"UTC\" Danish \"CET\". lang language. \"en\" english \"da\" danish. meta_data Meta data table. NULL meta data requested. format character value. \"CSV\" \"BULK\". choose BULK need select value parameters. value_presentation now, \"value\" \"default\"","code":""},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":null,"dir":"Reference","previous_headings":"","what":"This functions downloads all the available tables. — dst_get_tables","title":"This functions downloads all the available tables. — dst_get_tables","text":"functions downloads available tables.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This functions downloads all the available tables. — dst_get_tables","text":"","code":"dst_get_tables(lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/reference/dst_get_tables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This functions downloads all the available tables. — dst_get_tables","text":"lang \"da\" (danish) \"en\" (english)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":null,"dir":"Reference","previous_headings":"","what":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"function POSTs request meta data table Statistics Denmark returns JSON object information.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"","code":"dst_meta(table, ..., lang = \"da\")"},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function returns meta data for a table from StatBank Denmark / Statistics Denmark. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta","text":"table name table want meta data . ... Ignored. lang can choose \"en\" english \"da\" danish.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"function structures JSON data bit creates basic_query. tables large, basic request rather simple. function returns list basic data, info available variables list basic request.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"","code":"dst_meta_parse(meta, lang)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_meta_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function parses the JSON from the StatBank. (http://www.statistikbanken.dk/statbank5a/ or http://www.dst.dk) — dst_meta_parse","text":"meta returned meta data function meta_dst. lang language orignal dst_meta function (due error API)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to return ids based on text values — dst_query_match","title":"Helper function to return ids based on text values — dst_query_match","text":"helper function return ids based text values.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to return ids based on text values — dst_query_match","text":"","code":"dst_query_match(table, lang, meta_data, query, format)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_query_match.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to return ids based on text values — dst_query_match","text":"table Table StatBank. lang language. \"en\" english \"da\" danish. meta_data meta data object extract values query query match format Format specify match csv import (used)","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":null,"dir":"Reference","previous_headings":"","what":"This function provides a search function for the description field of available data series — dst_search","title":"This function provides a search function for the description field of available data series — dst_search","text":"function provides search function description field available data series","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This function provides a search function for the description field of available data series — dst_search","text":"","code":"dst_search(string = \"gpd\", field = \"text\", lang = \"da\", use_cache = NULL)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_search.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This function provides a search function for the description field of available data series — dst_search","text":"string Character string. Speficies search term. field Character string. lang Character. \"da\" danish \"en\" english. use_cache logical scalar. function call Statbank use (possibly outdated) saved version tables?","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":null,"dir":"Reference","previous_headings":"","what":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"helper function returns number values call return. API limit 100.000 values.","code":""},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"","code":"dst_value_limit(query, dst_meta)"},{"path":"https://ropengov.github.io/dkstat/reference/dst_value_limit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This is a helper function that returns the number of values the call will return. The API has a limit of 100.000 values. — dst_value_limit","text":"query Query object analyse dst_meta Meta data filer query ","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":null,"dir":"Reference","previous_headings":"","what":"Cached list of all available tables with danish names and descriptions — tables_da","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"Cached list available tables danish names descriptions","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"","code":"tables_da"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/tables_da.html","id":"tables-da","dir":"Reference","previous_headings":"","what":"tables_da","title":"Cached list of all available tables with danish names and descriptions — tables_da","text":"data frame 2339 rows 8 columns: id Unique ID table text Description table unit unit values represented table updated table last updated firstPeriod time first observation table latestPeriod time latest observation table active Binary indicator table active variables List variables table","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":null,"dir":"Reference","previous_headings":"","what":"Cached list of all available tables — tables_en","title":"Cached list of all available tables — tables_en","text":"Cached list available tables","code":""},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cached list of all available tables — tables_en","text":"","code":"tables_en"},{"path":[]},{"path":"https://ropengov.github.io/dkstat/reference/tables_en.html","id":"tables-en","dir":"Reference","previous_headings":"","what":"tables_en","title":"Cached list of all available tables — tables_en","text":"data frame 2339 rows 8 columns: id Unique ID table text Description table unit unit values represented table updated table last updated firstPeriod time first observation table latestPeriod time latest observation table active Binary indicator table active variables List variables table","code":""}]