Skip to content

Commit

Permalink
fix: underlying data for actual vs predicted (linetype) #1187
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Dec 23, 2024
1 parent 41dc5f5 commit 5788dd6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,14 @@ robyn_onepagers <- function(
## 5. Fitted vs actual
xDecompVecPlotMelted <- temp[[sid]]$plot5data$xDecompVecPlotMelted %>%
mutate(
linetype = ifelse(.data$variable == "predicted", "solid", "dotted"),
variable = stringr::str_to_title(.data$variable),
ds = as.Date(.data$ds, origin = "1970-01-01")
)
p5 <- ggplot(
xDecompVecPlotMelted,
aes(x = .data$ds, y = .data$value, color = .data$variable)
) +
geom_path(aes(linetype = .data$linetype), size = 0.6) +
geom_path(aes(linetype = .data$variable), size = 0.5) +
theme_lares(background = "white", legend = "top", pal = 2) +
scale_y_abbr() +
guides(linetype = "none") +
Expand Down Expand Up @@ -1332,7 +1331,6 @@ refresh_plots_json <- function(json_file, plot_folder = NULL, listInit = NULL, d
if (!is.null(df)) {
xDecompVecPlotMelted <- df$plot5data$xDecompVecPlotMelted %>%
mutate(
linetype = ifelse(.data$variable == "predicted", "solid", "dotted"),
variable = stringr::str_to_title(.data$variable),
ds = as.Date(.data$ds, origin = "1970-01-01")
)
Expand All @@ -1358,7 +1356,7 @@ refresh_plots_json <- function(json_file, plot_folder = NULL, listInit = NULL, d
)) %>%
as_tibble()
outputs[["pFitRF"]] <- pFitRF <- ggplot(xDecompVecPlotMelted) +
geom_path(aes(x = .data$ds, y = .data$value, color = .data$variable, linetype = .data$linetype), size = 0.6) +
geom_path(aes(x = .data$ds, y = .data$value, color = .data$variable, linetype = .data$variable), size = 0.5) +
geom_rect(
data = dt_refreshDates,
aes(
Expand Down

0 comments on commit 5788dd6

Please sign in to comment.