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
WIP: Move thisfile() to this package #12
Conversation
|
Any chance we could help push this forward? This is an essential function for our workflow, and would love to have it available at a public package in |
|
Oh, kimisc is on CRAN, but I'm thinking about retiring it, because most of the functionality is available elsewhere. |
|
Thanks. Do you have more feedback for this functionality? Happy to merge once the tests go green. |
|
This is similar (but better) to what we've been building out. so, no, looks good to me! |
R/thisfile.R
Outdated
| #' script. This is an attempt to circumvent this limitation by applying | ||
| #' heuristics (such as call stack and argument inspection) that work in many | ||
| #' cases. | ||
| #' @details This functions currently work only if the script was \code{source}d, |
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 feel like this needs a stronger caveat - i.e. typically this function is not actually want. Instead you should re-think your approach.
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.
@hadley Would love to hear instances where re-thinking the approach provides a better solution. This has seemingly come up a few times (setting up devops for automated build of R reports, as well as a robust team approach with R), where it's challenging / impossible to robustly guarantee the working directory stays as we wish.
If we can avoid it, that'd be great.. but I'm probably too new with R to rethink well myself. Any examples of rethinking the approach might help shed some light (and be helpful to end-users if added to the docs above). Thanks!
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 have no idea what you're doing, so I think it would be easier for you to describe what you're attempting to do. I'd say 90% of the cases I've seen where people are attempting to get the path of the running it script were ill-advised. Instead, it's usually better to set it outside the context of the script.
|
I added the caveat, and the vignette got two new examples thanks to @BarkleyBG. Merging and preparing for release. |
Fixes #8.