I feel like I am missing something with the
here() package. I am trying to upload some folders up to the Dataverse data repository and the .Rproj files are creating some problems with the ingest. So I'm trying to use
here() without them. However, I don't think I'm getting it quite right.
When I download the necessary folders from my draft dataverse, they end up in the
Downloads folders. But others might have their files save on their desktops, or their root directory. I get that
here() is supposed to address this situation. When I open the .R file (
~/Downloads/file.R ) (without a project file) as if I were a user encountering the data for the first time, then the working directory is my root directory.
I tried adding a
.here file to the folder that I downloaded, but
here() is still returning the root directory. I also tried using
set_here("~/Downloads") and it did create a
.here file in the Downloads directory but
here() still only returns the root directory.
The problem is that the code assumes that the working directory is the folder that the
.R file is in to start reading in the data in the subfolders. Again, I thought that the
here() package was supposed to address all of this, and I could do it so easily with the .Rproj files, but that may not be available to me.
Steps taken so far -
- RStudio Edition: Desktop
- RStudio Version: 1.2.5019
- OS Version: 10.14.6 (Mojave)
- R Version: 3.6.1