Skip to content

Commit

Permalink
bquote doesne work with ifelse
Browse files Browse the repository at this point in the history
  • Loading branch information
CeresBarros committed Jul 29, 2024
1 parent 562a738 commit a4d0b7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/plot_timeSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ plot.ensemble <- function(x, var, scenarios.selected, scenarios,
} else if (element %in% c("Tave", "Tmin", "Tmax", "MCMT", "MWMT", "EXT", "EMT", "MAT")) {
change <- round(projected - baseline, 1)
if (is.na(change) == FALSE) {
txt <- ifelse(change > 0, bquote("+" * .(change) * degree * C), bquote(.(change) * degree * C))
## ifelse won't work with bquote.
txt <- if (change > 0) bquote("+" * .(change) * degree * C) else bquote(.(change) * degree * C)
text(2099, projected, txt, col = colSel, pos = 4, font = 2, cex = 1)
}
} else if (element %in% c("RH")) {
Expand Down

0 comments on commit a4d0b7e

Please sign in to comment.