-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
box::use
searches wrong path when sourced from file in RStudio
#225
Comments
The question is: why is |
Correct, that is indeed the question! To be clear, this not the global module search path, since I can say with confidence that the working directory was While I haven't had a chance to fire up my work computer, I suspect that RStudio defaults to my |
Have you considered incorporating the This could be used in default behavior for
Alternatively, you could automatically attempt this call to
Then again, I fully understand if you want to limit dependency on external packages that (unlike |
That isn’t a bad idea by any means. But ‘box’ already implements (some of) the same functionality, so it shouldn’t need ‘this.path’ (it implements it differently, but for reasons that shouldn’t matter here). Anyway, I’ve just now found out why ‘box’ fails here so I should have a fix soon. I also found another (unrelated) bug in the functionality, so this was worthwhile! Apart from the above: as you’ve guessed, keeping ‘box’ free of dependencies is an important goal, since it’s an “infrastructure package”, so its installation should both be as easy as possible, and not depend on other things that might break. |
Great to know! Thank you for your transparency and attentiveness, Konrad! I do have one further question: is there a way to permanently set the Ideally, one might wish to set Thanks again! — Greg |
I’m not sure I understand … (why) can’t you persist the option inside your Alternatively, and just like the package library path, you can use an environment variable to set the path, |
Thanks, I'll check out those links! I was merely hoping there might be functionality within |
Hmm I think we might be talking past each other. The way I mentioned definitely allows to persist this configuration “permanently”, effortlessly, and I’m fairly sure that this is the intended way as far as R is concerned. Of course ‘box’ could maintain its own configuration file and variables instead of using R’s provide options but to what end? (If I understand the ‘bigrquery’ use-case correctly then it’s different because it stores credentials, which are potentially sensitive user secrets, so they shouldn’t necessarily reside in the regular . Or are you looking for a function inside ‘box’ which merely writes the configuration to the user’s save_module_path = function (path) {
init_code = sprintf('options(box.path = %s)', deparse(path))
writeLines(init_code, Sys.getenv('R_PROFILE_USER'))
} … to be honest I don’t see the value of such a function because it automates a process that’s already trivial (= open the |
Thank you for this detailed explanation! I certainly appreciate your reasoning, and I'm very inclined to agree. Regarding your statement
the only reason I wanted such a function is that these scripts, which employ However, given the complications, I should probably just do it manually. Thanks again! — Greg |
* Fix loading inside RStudio. Fixes #225. * Work around R bug with spaces in paths on Unix
* Fix loading inside RStudio. Fixes klmr#225. * Work around R bug with spaces in paths on Unix
Via Stack Overflow:
The text was updated successfully, but these errors were encountered: