Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsafe expression evaluation with callr #174
Conversation
This comment has been minimized.
This comment has been minimized.
|
}) | ||
}) | ||
} | ||
|
||
|
||
safe_env <- function() { |
This comment has been minimized.
This comment has been minimized.
wch
Jul 31, 2018
Collaborator
It would be helpful to have a comment of why this function exists (because it's the same as the default for callr::r
except that it allows opening a browser).
This comment has been minimized.
This comment has been minimized.
Waiting to see response from r-lib/callr#72 about |
This comment has been minimized.
This comment has been minimized.
|
#' @examples | ||
#' \dontrun{ | ||
#' # Direct usage | ||
#' safe({learnr::run_tutorial("slidy", package = "learnr")}) |
This comment has been minimized.
This comment has been minimized.
wch
Aug 3, 2018
Collaborator
I think having { }
around code that's used as an expression is good for some contexts (e.g., shiny and profvis), but in this case, it might just be confusing for ordinary users of learnr.
For this example, I think you also don't want learnr::
, to keep things simple for users.
Here's what you'd end up with after those two changes. This will be easier for new users to comprehend:
safe(run_tutorial("slidy", package = "learnr"))
This comment has been minimized.
This comment has been minimized.
schloerke
Aug 3, 2018
Author
Collaborator
No problem, I can remove the brackets.
To get the code to work, I'd need to library the learnr package. Makes sense as it's in the learnr package.
This comment has been minimized.
This comment has been minimized.
@wch Any idea on how to get around not having to require the user to say
as the Environment variable? |
schloerke commentedJul 27, 2018
•
edited
Address scoping issues within #162
Pre rendered documents can now be rendered in a clean environment using:
Tutorials should be able to be run in a clean environment using:
This is done as rmarkdown has no intent on adding a new session for compilation. rstudio/rmarkdown#1204