Skip to content

Commit 6b82260

Browse files
Expose only cached table with english names
1 parent ebe14d4 commit 6b82260

8 files changed

+12
-59
lines changed

R/dst_search.R

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ dst_search <- function(string = "gpd",
1717

1818
series <- httr::content(httr::GET(url = url))
1919
series <- jsonlite::fromJSON(txt = series)
20-
} else if (!is.null(use_cache) && lang == "da") {
21-
series <- dkstat::tables_da
2220
} else {
23-
series <- dkstat::tables_en
21+
series <- dkstat::tables
2422
}
2523

2624
matches <- grep(string, series[, field], ignore.case = TRUE)

R/dst_tables.R

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Cached list of all available tables
22
#'
3-
#' @format ## `tables_en`
3+
#' @format ## `tables`
44
#' A data frame with 2339 rows and 8 columns:
55
#' \describe{
66
#' \item{id}{Unique ID of the table}
@@ -12,20 +12,4 @@
1212
#' \item{active}{Binary indicator of the table being active}
1313
#' \item{variables}{List of the variables in the table}
1414
#' }
15-
"tables_en"
16-
17-
#' Cached list of all available tables with danish names and descriptions
18-
#'
19-
#' @format ## `tables_da`
20-
#' A data frame with 2339 rows and 8 columns:
21-
#' \describe{
22-
#' \item{id}{Unique ID of the table}
23-
#' \item{text}{Description of the table}
24-
#' \item{unit}{The unit of the values represented in the table}
25-
#' \item{updated}{When this table was last updated}
26-
#' \item{firstPeriod}{The time of the first observation in the table}
27-
#' \item{latestPeriod}{The time of the latest observation in the table}
28-
#' \item{active}{Binary indicator of the table being active}
29-
#' \item{variables}{List of the variables in the table}
30-
#' }
31-
"tables_da"
15+
"tables"

data-raw/dst_tables.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tables_en <- dst_get_tables(lang = "en")
1+
tables <- dst_get_tables(lang = "en")
22

3-
usethis::use_data(tables_en, overwrite = TRUE)
3+
usethis::use_data(tables, overwrite = TRUE)
44

5-
tables_da <- dst_get_tables(lang = "da")
6-
7-
usethis::use_data(tables_da, overwrite = TRUE)
5+
# tables_da <- dst_get_tables(lang = "da")
6+
#
7+
# usethis::use_data(tables_da, overwrite = TRUE)

data/tables.rda

46.2 KB
Binary file not shown.

data/tables_da.rda

-47.1 KB
Binary file not shown.

data/tables_en.rda

-46.2 KB
Binary file not shown.

man/tables_en.Rd man/tables.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tables_da.Rd

-29
This file was deleted.

0 commit comments

Comments
 (0)