diff --git a/R/dst_search.R b/R/dst_search.R index 9bb87ad..0facda6 100644 --- a/R/dst_search.R +++ b/R/dst_search.R @@ -17,10 +17,8 @@ dst_search <- function(string = "gpd", series <- httr::content(httr::GET(url = url)) series <- jsonlite::fromJSON(txt = series) - } else if (!is.null(use_cache) && lang == "da") { - series <- dkstat::tables_da } else { - series <- dkstat::tables_en + series <- dkstat::tables } matches <- grep(string, series[, field], ignore.case = TRUE) diff --git a/R/dst_tables.R b/R/dst_tables.R index af83a0f..09bed7b 100644 --- a/R/dst_tables.R +++ b/R/dst_tables.R @@ -1,6 +1,6 @@ #' Cached list of all available tables #' -#' @format ## `tables_en` +#' @format ## `tables` #' A data frame with 2339 rows and 8 columns: #' \describe{ #' \item{id}{Unique ID of the table} @@ -12,20 +12,4 @@ #' \item{active}{Binary indicator of the table being active} #' \item{variables}{List of the variables in the table} #' } -"tables_en" - -#' Cached list of all available tables with danish names and descriptions -#' -#' @format ## `tables_da` -#' A data frame with 2339 rows and 8 columns: -#' \describe{ -#' \item{id}{Unique ID of the table} -#' \item{text}{Description of the table} -#' \item{unit}{The unit of the values represented in the table} -#' \item{updated}{When this table was last updated} -#' \item{firstPeriod}{The time of the first observation in the table} -#' \item{latestPeriod}{The time of the latest observation in the table} -#' \item{active}{Binary indicator of the table being active} -#' \item{variables}{List of the variables in the table} -#' } -"tables_da" +"tables" diff --git a/data-raw/dst_tables.R b/data-raw/dst_tables.R index 1070970..3a634d8 100644 --- a/data-raw/dst_tables.R +++ b/data-raw/dst_tables.R @@ -1,7 +1,7 @@ -tables_en <- dst_get_tables(lang = "en") +tables <- dst_get_tables(lang = "en") -usethis::use_data(tables_en, overwrite = TRUE) +usethis::use_data(tables, overwrite = TRUE) -tables_da <- dst_get_tables(lang = "da") - -usethis::use_data(tables_da, overwrite = TRUE) +# tables_da <- dst_get_tables(lang = "da") +# +# usethis::use_data(tables_da, overwrite = TRUE) diff --git a/data/tables.rda b/data/tables.rda new file mode 100644 index 0000000..e2f4dc1 Binary files /dev/null and b/data/tables.rda differ diff --git a/data/tables_da.rda b/data/tables_da.rda deleted file mode 100644 index c2cec06..0000000 Binary files a/data/tables_da.rda and /dev/null differ diff --git a/data/tables_en.rda b/data/tables_en.rda deleted file mode 100644 index 503cacc..0000000 Binary files a/data/tables_en.rda and /dev/null differ diff --git a/man/tables_en.Rd b/man/tables.Rd similarity index 90% rename from man/tables_en.Rd rename to man/tables.Rd index 58be65d..0a21a37 100644 --- a/man/tables_en.Rd +++ b/man/tables.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/dst_tables.R \docType{data} -\name{tables_en} -\alias{tables_en} +\name{tables} +\alias{tables} \title{Cached list of all available tables} \format{ -\subsection{\code{tables_en}}{ +\subsection{\code{tables}}{ A data frame with 2339 rows and 8 columns: \describe{ @@ -21,7 +21,7 @@ A data frame with 2339 rows and 8 columns: } } \usage{ -tables_en +tables } \description{ Cached list of all available tables diff --git a/man/tables_da.Rd b/man/tables_da.Rd deleted file mode 100644 index 652d86e..0000000 --- a/man/tables_da.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dst_tables.R -\docType{data} -\name{tables_da} -\alias{tables_da} -\title{Cached list of all available tables with danish names and descriptions} -\format{ -\subsection{\code{tables_da}}{ - -A data frame with 2339 rows and 8 columns: -\describe{ -\item{id}{Unique ID of the table} -\item{text}{Description of the table} -\item{unit}{The unit of the values represented in the table} -\item{updated}{When this table was last updated} -\item{firstPeriod}{The time of the first observation in the table} -\item{latestPeriod}{The time of the latest observation in the table} -\item{active}{Binary indicator of the table being active} -\item{variables}{List of the variables in the table} -} -} -} -\usage{ -tables_da -} -\description{ -Cached list of all available tables with danish names and descriptions -} -\keyword{datasets}