Call a function in the R of another Pixi environment, e.g. one with another
version of R, and get its result back, like callr::r(). The function runs
in a new R process, started with pixi run, so it uses that environment's
R and packages; your current R is left alone.
The function and its arguments are copied to the new R, but not the
variables around it. Refer to packages with :: or load them in the
function, and pass in what it needs as arguments.
Usage
pixi_r(func, args = list(), environment = NULL, show = TRUE, path = NULL)Examples
if (FALSE) { # \dontrun{
pixi_r(function() R.version.string, environment = "r44")
pixi_r(function(x) packageVersion(x), list("dplyr"), environment = "r44")
} # }