here icon indicating copy to clipboard operation
here copied to clipboard

Is RStudio required for `here::i_am()`?

Open seed-of-apricot opened this issue 2 years ago • 6 comments

The below is what I get when I run the command. here::here() seems to work without the .Rproj file though.

> here::i_am("README.Rmd")
Error: Could not find associated project in working directory or any parent directory.
- Path in project: README.Rmd
- Current working directory: [path]
Please open the project associated with this file and try again.

> here::dr_here(show_reason = TRUE)
here() starts at [path].
- This directory contains a directory ".git"
- Initial working directory: [path]
- Current working directory: [path]

seed-of-apricot avatar Jul 19 '21 18:07 seed-of-apricot

I had the same issue. Without the project file within R-Studio, here gives a message like above. This seems to be due to the "default directory" that is (automatically) set in the preferences. If I open the file in visual code or emacs, the problem does not happen.

arnyeinstein avatar Jul 25 '21 14:07 arnyeinstein

Any resolution to this? I'm dying with this issue and have been at it all day - I can't find anything in the rproj.user files or anything

KWigg4 avatar Jul 16 '22 22:07 KWigg4

When I ran into this issue just now, it took me a while to realize it was a typical stupid error: I had written here::i_am("code/model-altas.r") where the file was actually called model-atlas.r. So if you run into this error and cannot figure out the reason, check the spelling of your file name :see_no_evil:

Anaphory avatar Aug 17 '22 15:08 Anaphory