Skip to content

Commit

Permalink
CRON Job (#22)
Browse files Browse the repository at this point in the history
* CRON Job

* Fix example error, exclude folder
  • Loading branch information
wklimowicz authored May 10, 2024
1 parent cc3a438 commit eac5cfd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
^lfs_variables_report\.csv$
^aps_variables_report\.csv$
^data-raw$
^lfs_documentation$
^_pkgdown\.yml$
^docs$
^pkgdown$
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: "0 0 * * 1" # Once a week on monday

name: R-CMD-check

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ VignetteBuilder:
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
14 changes: 7 additions & 7 deletions R/api.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
#'
#' @param dataset_id Name of ONS dataset
#' @param timeseries_id Name of ONS time series
#' @return A Jsonlite(?) object from the ONS API
#' @return A list converted from json from the ONS API
#' @keywords internal
#' @examples
#'
#' @export
#' @examplesIf interactive()
#' # CPIH Inflation
#' ons_time_series("MM23", "L55O") %>%
#' purrr::pluck("years") %>%
#' ons_time_series("MM23", "L55O") |>
#' purrr::pluck("years") |>
#' dplyr::select(date, value)
#'
#' # Unemployment Rate
#' ons_time_series("LMS", "MGSX") %>%
#' purrr::pluck("months") %>%
#' ons_time_series("LMS", "MGSX") |>
#' purrr::pluck("months") |>
#' dplyr::select(date, value)
#' @export
ons_time_series <- function(dataset_id, timeseries_id) {
api_endpoint <- "https://api.ons.gov.uk/"

Expand Down
13 changes: 7 additions & 6 deletions man/ons_time_series.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eac5cfd

Please sign in to comment.