Skip to content

Commit

Permalink
Donttest examples (without token)
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs committed Jul 19, 2024
1 parent b5b4773 commit 913eddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: resios
Title: Interacts with REE and ESIOS API
Version: 0.1.0.9002
Version: 0.1.0.9003
Authors@R:
person("Lluís", "Revilla Sancho", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9747-2570"))
Expand Down
2 changes: 2 additions & 0 deletions R/esios-indicators.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ esios_indicators <- function(indicator, locale = NULL, datetime = NULL,
#' @seealso [esios_indicators()]
#' @export
#' @examples
#' \donttest{
#' e <- esios_pvpc()
#' }
esios_pvpc <- function(locale = NULL, datetime = NULL,
start_date = NULL, end_date = NULL,
time_agg = NULL, time_trunc = NULL, geo_agg = NULL,
Expand Down
5 changes: 4 additions & 1 deletion R/get_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' token <- get_token("aahdahgagdadfsafd")
get_token <- function(token = NULL) {
if (is.null(token)) {
token <- Sys.getenv("ESIOS_TOKEN", NA_character_)
token <- check_token()
}

if (is.na(token)) {
Expand All @@ -26,3 +26,6 @@ get_token <- function(token = NULL) {
}


check_token <- function() {
Sys.getenv("ESIOS_TOKEN", NA_character_)
}

0 comments on commit 913eddf

Please sign in to comment.