-
Notifications
You must be signed in to change notification settings - Fork 44
Feature request: reset the starting point of here()
automatically to the directory containing .here
when set_here()
is used
#28
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
Comments
Note: when one creates a |
Noobie's alert: this might be a naive comment and I could be totally wrong on this. But I feel that I can try to look at the code and see if I can come up with something that works to submit a PR if you were open to the suggestion. |
Totally agreed with this, just want to say that sometimes the |
I recently encountered other situations in which I would have liked to be able to reset the project root without having to relaunch R (after some change in directory structure while running an R session). So an alternative to having Running this function would solve all situations in which the root was set somewhere unintented or needs to be reset after some change. |
I found this issue thread because I was also trying to find a way to reset here mid session. I thought I'd comment for anyone else who finds this in the future because I was able to find a workaround. Start with your first .here path location
Then to reset, detach here, reset the working directory with setwd, and when you reload here, you'll be in the new directory
|
@tnoomah does this fix it for future referencing of |
@reidwil when you detach here, set the working directory manually and reload here, you create a new .here file which will be the point of reference for here going forward in your session. You only have to manually setwd when you want to change the location of your .here file, after that you can use here like you normally would. |
After |
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. |
Thanks a ton for the package. I love it and am following in Jenny's path in advocating its use instead of
setwd()
.My issue is closely related to jennybc/here_here#3 and #24.
Problem:
You need to create a
.here
file in a directory because it isn't big nor important enough to justify doing version control on it. But that directory is nested in another one which has a.something
file thathere
will use to set the "project" root. Now, usingset_here()
will create the.here
file just fine, buthere
has already been set and there is no way to update it unless restarting the R process (which creates a very awkward workflow and impairs automation).As mentioned in other issues re-running
library(here)
(which wouldn't be a great solution anyway) has no effect. And I even tried runninghere::set_here()
before runninglibrary(here)
, but that does not work either. Reloading R is the only solution.Suggestion:
set_here()
does what it should and work great whenhere
hasn't been set on a wrong target (due to something higher in the path than the intended project root), but fails when a wrong target was found. Having a function that would automatically run while usingset_here()
to reset here to the location of the.here
file that has just been created would be more robust and cover situations such as the one I am describing.The text was updated successfully, but these errors were encountered: