diff --git a/index.html b/index.html index 74d2196..c8d2a29 100644 --- a/index.html +++ b/index.html @@ -244,8 +244,10 @@
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))
## '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".
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".
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.
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.
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.
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)
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
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?