Skip to content

Commit

Permalink
Fix some problems
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs committed Sep 24, 2023
1 parent 2d9dcc7 commit f3c2aa3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ BugReports: https://github.com/llrs/resios/issues
Depends:
R (>= 4.2)
Imports:
httr2 (>= 0.2.3)
httr2 (>= 0.2.3),
methods
Suggests:
testthat (>= 3.0.0)
Config/Needs/website: rmarkdown
Expand Down
8 changes: 4 additions & 4 deletions R/check_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ check_category_widget <- function(category, widget) {
}

region <- c("peninsular", "canarias", "baleares", "ceuta", "melilla",
"Andalucía", "Aragón", "Cantabria", "Castilla la Mancha",
"Castilla y León", "Cataluña", "País Vasco",
"Andaluc\u00EDa", "Arag\u00F3n", "Cantabria", "Castilla la Mancha",
"Castilla y Le\u00F3n", "Catalu\u00F1a", "Pa\u00EDs Vasco",
"Principado de Asturias", "Comunidad de Ceuta",
"Comunidad de Melilla", "Comunidad de Madrid",
"Comunidad de Navarra", "Comunidad Valenciana", "Extremadura",
"Galicia", "Islas Baleares", "Islas Canarias", "La Rioja",
"Región de Murcia")
"Regi\u00F3n de Murcia")

geo_id <- c(8741, 8742, 8743, 8744, 8745, 4, 5, 6, 7, 8, 9, 10, 11, 8744, 8745,
13, 14, 15, 16, 17, 8743, 8742, 20, 21)
Expand All @@ -114,7 +114,7 @@ ree_region <- function(region) {
}
# 2014-01-01T00:00
ree_date <- function(date) {
if (is(date, "Date")) {
if (methods::is(date, "Date")) {
return(strftime(date , "%Y-%m-%dT%H:%M"))
}
date
Expand Down
22 changes: 11 additions & 11 deletions R/ree-apidatos.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
#' time_trunc = "month",
#' region = "peninsular", lang = "en",
#' category = "demanda", widget = "ire-general")
#' rc2 <- ree_call(category = "balance", widget = "balance-electrico",
#' start_date = "2022-12-31T23:59",
#' region = "peninsular", lang = "en", time_trunc = "day")
#' rc3 <- ree_call(lang = "es",
#' category = "generacion",
#' widget = "estructura-generacion",
#' start_date = "2014-01-01T00:00",
#' end_date = "2018-12-31T23:59",
#' time_trunc = "year",
#' geo_trunc = "electric_system",
#' region = "Castilla la Mancha")
#' # rc2 <- ree_call(category = "balance", widget = "balance-electrico",
#' # start_date = "2022-12-31T23:59",
#' # region = "peninsular", lang = "en", time_trunc = "day")
#' # rc3 <- ree_call(lang = "es",
#' # category = "generacion",
#' # widget = "estructura-generacion",
#' # start_date = "2014-01-01T00:00",
#' # end_date = "2018-12-31T23:59",
#' # time_trunc = "year",
#' # geo_trunc = "electric_system",
#' # region = "Castilla la Mancha")
ree_call <- function(category, widget,
start_date = end_date - 1,
end_date = Sys.Date(),
Expand Down
22 changes: 11 additions & 11 deletions man/ree_call.Rd

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

0 comments on commit f3c2aa3

Please sign in to comment.