Skip to content

Commit 2fa4333

Browse files
committed
vignettes adjusted such a way that those can be build without internet access or credentials from now on
1 parent e145f58 commit 2fa4333

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ inst/doc
88
/doc/
99
/Meta/
1010
docs
11-
devel.R
11+
devel/

vignettes/da-price-spread-vignette.Rmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
1113
knitr::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}
2224
library(entsoeapi)
2325
library(dplyr) |> suppressPackageStartupMessages()
2426
library(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}
3234
pl_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}
4850
da_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}
6062
da_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}
8183
ggplot(data = da_spreads) +
8284
geom_segment(
8385
mapping = aes(

0 commit comments

Comments
 (0)