-
Notifications
You must be signed in to change notification settings - Fork 2
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
Set wd rather than using root= in vignettes #117
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 40 40
Lines 3512 3513 +1
=========================================
+ Hits 3512 3513 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a suggestion about moving the hook (and some existing code) to a common file.
vignettes/dependencies.Rmd
Outdated
@@ -28,6 +28,16 @@ inline <- function(x) { | |||
|
|||
knitr::opts_chunk$set( | |||
collapse = TRUE) | |||
|
|||
.here <- getwd() | |||
knitr::knit_hooks$set(inwd = function(before, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth moving a lot of this block into a common file that gets sourced by all the vignettes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, good shout. I think we can do that with source()
- I'll give that a go and see...
As discussed in mrc-4725, try and make things a bit more obvious. I've kept the explicit temporary directory used in the initial call to
orderly_init
but added a more explicit note, then used a knitr hook to change directory for the chunks that need it. It's generally not reliable to change for the whole document; knitr will try and change back, and generated files end up in the wrong place. We already used this approach to simplify the "collaboration" vignette