Multiple projects using the same data

I have multiple projects, each with multiple R scripts, that I would like to keep separate that use the same large data set. Currently I have a copy of the data set in each directory and use here() to read in the data. Is there any way the directories can be set up to access a single copy of the data?

You can use here("../") to access folders and files outside your project folder (i.e., project's working directory).
For example, you can put the shared data set in the folder named shared_data. Then read/import the data using read_csv(here("../shared_date/my_data.csv")).

The file structure may like this:

.
+-- project_01
|   +-- result
|   \-- scripts
+-- project_02
|   +-- result
|   \-- scripts
+-- project_03
|   +-- result
|   \-- scripts
\-- shared_data
    \-- my_data.csv
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.