@@ -7,7 +7,9 @@ vignette: >
77 %\VignetteEncoding{UTF-8}
88---
99
10- ``` {r, include = FALSE}
10+ ``` {r setup, include = FALSE}
11+ has_pat <- nchar(Sys.getenv("ENTSOE_PAT")) > 0L
12+
1113knitr::opts_chunk$set(
1214 collapse = TRUE,
1315 comment = "#>",
@@ -18,7 +20,7 @@ knitr::opts_chunk$set(
1820)
1921```
2022
21- ``` {r setup }
23+ ``` {r load packages, eval = identical(Sys.getenv("NOT_CRAN"), "true") && has_pat }
2224library(entsoeapi)
2325library(dplyr) |> suppressPackageStartupMessages()
2426library(lubridate) |> suppressPackageStartupMessages()
@@ -28,7 +30,7 @@ library(ggplot2)
2830
2931### Look for the Polish market EIC and set the start and the end of scope dates
3032
31- ``` {r preset constants}
33+ ``` {r preset constants, eval = identical(Sys.getenv("NOT_CRAN"), "true") && has_pat }
3234pl_eic <- all_approved_eic() |>
3335 filter(EicLongName == "Poland") |>
3436 select("EicCode") |>
@@ -44,7 +46,7 @@ cli_inform("till: {till_ts}")
4446
4547### Query the Polish DA prices within the pre-set period
4648
47- ``` {r query da prices}
49+ ``` {r query da prices, eval = identical(Sys.getenv("NOT_CRAN"), "true") && has_pat }
4850da_prices <- entsoeapi::day_ahead_prices(
4951 eic = pl_eic,
5052 period_start = from_ts,
@@ -56,7 +58,7 @@ glimpse(da_prices)
5658
5759### Calculate the daily minimum and maximum prices and the spread
5860
59- ``` {r calculate the daily spreads}
61+ ``` {r calculate the daily spreads, eval = identical(Sys.getenv("NOT_CRAN"), "true") && has_pat }
6062da_spreads <- da_prices |>
6163 select(c(ts_point_dt_start, ts_point_price_amount)) |>
6264 mutate(
@@ -77,7 +79,7 @@ da_spreads <- da_prices |>
7779
7880### Plot the daily minimum and maximum prices and the spread
7981
80- ``` {r plot the daily spreads}
82+ ``` {r plot the daily spreads, eval = identical(Sys.getenv("NOT_CRAN"), "true") && has_pat }
8183ggplot(data = da_spreads) +
8284 geom_segment(
8385 mapping = aes(
0 commit comments