Skip to content

Error while exporting plots #1059

@OmkarEllicium

Description

@OmkarEllicium

Project Robyn

Describe issue

Getting a weird error while saving pareto_alldecomp_matrix.csv: >> Exporting general plots into directory... Failed exporting results, but returned model results anyways: Error in theme[[element]]: attempt to select more than one element in vectorIndex

All other files are generated correctly:

image

Provide reproducible example

I am using following code:

 InputCollect <- robyn_inputs(
          dt_input = data,
          dt_holidays = dt_prophet_holidays,
          date_var = date_column, # date format must be "2020-01-01"
          dep_var = target_variable, # there should be only one dependent variable
          dep_var_type = "conversion", # "revenue" (ROI) or "conversion" (CPA)
          prophet_vars = c("trend", "season", "holiday"), # "trend","season", "weekday" & "holiday"
          prophet_country = "US", # input country code. Check: dt_prophet_holidays
          context_vars = contextual_variables,
          paid_media_spends = selected_paid_media_spends,
          paid_media_vars = selected_paid_media_vars,
          window_start = as.Date(lower_limit_date),
          window_end = as.Date(upper_limit_date),
          adstock = "geometric", # geometric, weibull_cdf or weibull_pdf.
        )
        hyperparameters <- create_hyperparameter_ranges(selected_paid_media_spends)
        InputCollect <- robyn_inputs(InputCollect = InputCollect, hyperparameters = hyperparameters)
      
        printlog("Running Robyn")
        OutputModels <- robyn_run(
          InputCollect = InputCollect, # feed in all model specification
          cores = NULL, # NULL defaults to (max available - 1)
          iterations = 2000, # 2000 recommended for the dummy dataset with no calibration
          trials = 5, # 5 recommended for the dummy dataset
          ts_validation = TRUE, # 3-way-split time series for NRMSE validation.
          add_penalty_factor = TRUE # Experimental feature. Use with caution.
        )
        plot_folder <- paste0(robyn_directory, job_run_id, '/', state)
        dir_exists <- dir.exists(plot_folder)
        if (!dir_exists) {
          dir.create(plot_folder, recursive = TRUE)
        }

        printlog("Collecting Robyn Outputs")
        OutputCollect <- robyn_outputs(
          InputCollect, OutputModels,
          pareto_fronts = "auto",
          csv_out = "all", # "pareto", "all", or NULL (for none)
          clusters = TRUE, # Set to TRUE to cluster similar models by ROAS. See ?robyn_clusters
          export = TRUE, # this will create files locally
          plot_folder = plot_folder, # path for plots exports and files creation
          plot_folder_sub = "",
          plot_pareto = FALSE # Set to FALSE to deactivate plotting and saving model one-pagers
        )

Environment & Robyn version

Make sure you're using the latest Robyn version before you post an issue.

  • Check and share Robyn version: packageVersion("Robyn")
  • R version (Please, check and share: sessionInfo() or R.version$version.string)

I can confirm that the Robyn version is: 3.11.1

Activity

jay-g-123

jay-g-123 commented on Nov 24, 2024

@jay-g-123

@gufengzhou @laresbernardo I am also having this same problem with version 3.11.1. Any idea what this could be?

sarasbissi

sarasbissi commented on Dec 2, 2024

@sarasbissi

I am getting the same issue, when runnnig:
if (OutputModels$ts_validation) OutputModels$ts_validation_plot
image

jcpulsar

jcpulsar commented on Jan 30, 2025

@jcpulsar

Hi, I have the same issue, has anyone been lucky and solved the issue?

gufengzhou

gufengzhou commented on Jan 31, 2025

@gufengzhou
Contributor

I can't reproduce this error. Do you have the same problem with the latest version?

self-assigned this
on Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @gufengzhou@OmkarEllicium@sarasbissi@jcpulsar@jay-g-123

      Issue actions

        Error while exporting plots · Issue #1059 · facebookexperimental/Robyn