Skip to content
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

Merged
merged 4 commits into from
Nov 20, 2023
Merged

Set wd rather than using root= in vignettes #117

merged 4 commits into from
Nov 20, 2023

Conversation

richfitz
Copy link
Member

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

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (86fbbb6) 100.00% compared to head (deddc8a) 100.00%.
Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@richfitz richfitz marked this pull request as ready for review November 20, 2023 09:44
@richfitz richfitz requested a review from plietar November 20, 2023 09:44
Copy link
Member

@plietar plietar left a 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.

@@ -28,6 +28,16 @@ inline <- function(x) {

knitr::opts_chunk$set(
collapse = TRUE)

.here <- getwd()
knitr::knit_hooks$set(inwd = function(before, options) {
Copy link
Member

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.

Copy link
Member Author

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...

@richfitz richfitz merged commit c065510 into main Nov 20, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants