Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Robyn
Type: Package
Title: Semi-Automated Marketing Mix Modeling (MMM) from Meta Marketing Science
Version: 3.12.0.9001
Version: 3.12.0.9002
Authors@R: c(
person("Gufeng", "Zhou", , "[email protected]", c("cre", "aut")),
person("Igor", "Skokan", , "[email protected]", c("aut")),
Expand Down
1 change: 1 addition & 0 deletions R/R/clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ errors_scores <- function(df, balance = rep(1, 3), ts_validation = TRUE, ...) {
}

.min_max_norm <- function(x, min = 0, max = 1) {
x[is.nan(x)] <- max
x <- x[is.finite(x)]
x <- x[!is.na(x)]
if (length(x) <= 1) {
Expand Down
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