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

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

Issue actions