I want to export a plotly object to a static image using plotly::orca on Win10, but I'm a getting the following error:
<c_error in rethrow_call(c_processx_exec, command, c(command, args), stdin, ...:
Command 'orca' not found @win/processx.c:983 (processx_exec)>
The problem seems to be not orca itself but processx::run. I wrote my own little orca function using base::system instead which works just fine.
Here is the same issue.
p <- plot_ly(mtcars, x = ~mpg, y = ~wt)
## Fails
plotly::orca(p)
## Works
file = "plot.png"; format = "png"
debug=verbose=safe=F
b <- plotly_build(p)
plotlyjs <- plotly:::plotlyjsBundle(b)
plotlyjs_path <- file.path(plotlyjs$src$file, plotlyjs$script)
if (!is.null(plotlyjs$package)) {
plotlyjs_path <- system.file(plotlyjs_path, package = plotlyjs$package)
}
tmp <- tempfile(fileext = ".json")
cat(plotly:::to_JSON(b$x[c("data", "layout")]), file = tmp)
args <- c("graph", tmp, "-o", file, "--format",
format, "--plotlyjs", plotlyjs_path, if (debug) "--debug",
if (verbose) "--verbose", if (safe) "--safe-mode")
base::system(paste("orca", paste(args, collapse = " ")))
I want to export a plotly object to a static image using
plotly::orcaon Win10, but I'm a getting the following error:The problem seems to be not
orcaitself butprocessx::run. I wrote my own littleorcafunction usingbase::systeminstead which works just fine.Here is the same issue.