Skip to content

Commit

Permalink
correct tooltip in convergence plot
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Jan 19, 2024
1 parent dd11e75 commit 35f3ac4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions R/plotNashConvergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,24 @@ plotNashConvergence <- function(gdx) { # nolint cyclocomp_linter
)[, , "good"] %>%
as.numeric()

data <- readGDX(gdx, name = "p80_DevPriceAnticipGlobAllMax2100Iter",
restore_zeros = FALSE, react = "error") %>%
data <- readGDX(gdx,
name = "p80_DevPriceAnticipGlobAllMax2100Iter",
restore_zeros = FALSE, react = "error"
) %>%
as.quitte() %>%
select("iteration", "value") %>%
mutate(
"iteration" := as.numeric(.data$iteration),
"converged" = ifelse(.data$value > 0.1 * maxTolerance, "no", "yes"),
"text" = "hallo"
"tooltip" = ifelse(.data$value > 0.1 * maxTolerance,
paste0(
"Not converged<br>Price Anticipation deviation is not low enough<br>",
round(.data$value, 5), " > ", 0.1 * maxTolerance
),
"Converged"
),
)


priceAnticipationDeviation <- ggplot(data, aes_(x = ~iteration)) +
suppressWarnings(geom_point(
size = 2,
Expand Down
2 changes: 1 addition & 1 deletion inst/markdown/nashAnalysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ for (v in setdiff(unique(prices_and_surplus_scaled$all_enty), "good")) {
```

## Convergence Plots
```{r results = "asis", fig.width=12, fig.height=6}
```{r results = "asis", fig.height=10}
diag <- plotNashConvergence(gdx = params$gdx)
htmltools::tagList(diag$plot)
htmltools::tagList(diag$tradeDetailPlot)
Expand Down

0 comments on commit 35f3ac4

Please sign in to comment.