-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Warn if working directory has changed since loading the package? #18
Comments
I have definitely felt this pain, although not recently. But agree it would be great to have a helping hand / warning flag. |
Is there a reason To me this is by far the biggest issue with the |
You shouldn't have to use # Linux, OS X
file.symlink(here("path/to/local/link"), "/mnt/some/remote/location")
# Windows
Sys.junction(here("path/to/local/link"), "S:/Ome/Remote/Location") If you have a use case that doesn't work for you, would you mind asking at https://community.rstudio.com or on StackOverflow? |
My issue is that I'm collaborating on a GitHub repo with some other researchers and we're working on RStudio-Server together. Any time we log in, our r-session starts our working directory off at the top level of of our home folder (i.e. I have directory X at the path If we run our scripts without doing anything, we both get that the data cannot be found, since We use At the very least, I wish |
Can you use a project file ( In RStudio, choose File/New Project/Existing Directory, this will create an |
It seems like there should be a way to re-initialize here's state. |
@jennybc: I'd say this is out of scope for here -- there's rprojroot that can do this and much more. |
Either way, is there a reason why I hope there's also a good reason for |
here is a simple wrapper around the much more powerful rprojroot package. I intend too keep the functionality very limited but still useful for many use cases. To use here effectively with RStudio or RStudio Server, it helps a lot if you work in projects ( here is stubborn about its notion of the project root. This means that once it has picked up the project root, it stays unchanged -- once you have set it up in a way that it works in your session, no abuse of |
Understandable. Still think it'd be worth having library(here) run through the process of finding the project root again, but maybe that's just me. |
here isn't notified about a second call to Have you tried an RStudio project ( |
I have -- it works fine, just using projects isn't typically part of my workflow. I think I'll be sticking to my existing solution as its not too much of a pain to deal with, but I'll just +1 the exported function idea. |
This feels like And yet they are exported because you just can't account for every use case and sometimes people don't have all the control they would like over a project. |
@kmishra9: Read more at: https://here.r-lib.org/articles/here.html#declare-the-location-of-the-current-script-1 |
- `dr_here()` shows the initial and current working directory (#18).
The solution sounds pretty good! I've also done a 180 on using R Projects and can't imagine living without them, so there's that as well 🤷 |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
Inspired by jennybc/here_here#3 (comment): Perhaps
dr_here()
should tell the user that the working directory has changed since the package was loaded? Or at least print the w.d. that was effective when the package was loaded?@jennybc: What do you think?
The text was updated successfully, but these errors were encountered: