-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rgl output in snippets. #405
Conversation
I didn't add a test of the new feature. It should be something like
but I don't know how to test for the correct output. |
Thanks, yes it works for me locally! @cderv Would you take a quick look at this? I'd appreciate your confirmation that this is the most logical way to insert the rgl feature. I suppose I expected to see it in the render function, more than in the output format. But I haven't thought about reprex and output formats, specifically, in a long time. |
As for a test, there are no existing tests for even more plain vanilla plot handling. So I think it is OK / self-consistent to leave this untested. This package is only meant to be used interactively. So my basic posture for tricky-to-test features is if something is truly useful and well-used and it stops working? Someone will tell me. |
If really added in reprex, this*makes sense to me to add We could also wonder why not add this directly in rmarkdown or knitr if this is needed anyway when rgl is used in a Rmd document. I am not quite sure from https://dmurdoch.github.io/rgl/dev/reference/setupKnitr.html if this is safe (and recommended) to run in every document that uses rgl. What is the recommendation @dmurdoch ? And if this is something that is required no matter the output format, I also wonder if this kind of setup should be done instead in the used package itself. 🤔 Anyway, in the current state of things, if using rgl object in a reprex requires to run |
The This could probably be done in |
Yes, there is an option, that is set inside This was added so that the renv package could tailor its inclusion of the lockfile and seems related to this rgl-specific request. More re: the context can be read here: I'll wait on this PR a bit, until it's clear if it makes more sense to do something inside rgl, instead of reprex. |
I think it would make more sense to have this in |
Closes #404
This gets
knitr
to include snapshots ofrgl
output if rgl is loaded within the snippet.It should have almost no side effects if
rgl
is not used.To disable snapshot inclusion in a code snippet, you can run
or, before running any other code that would load
rgl
,