You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that there is no forward slash at the beginning of a relative path; if we accidentally typed `"/data/happiness_report.csv"`,
120
120
R would look for a folder named `data` in the root folder of the computer—but that doesn't exist!
121
121
122
-
Aside from specifying places to go in a path using folder names (like `data` and `worksheet_02`), we can also specify two additional
122
+
Aside from specifying places to go in a path using folder names (like `data` and `project3`), we can also specify two additional
123
123
special places: the *current directory* \index{path!current} and the *previous directory*. \index{path!previous}
124
124
We indicate the current working directory with a single dot `.`, and \index{aaaaaacurdirsymb@\texttt{.}|see{path}}
125
-
the previous directory with two dots `..`. \index{aaaaaprevdirsymb@\texttt{..}|see{path}} So for instance, if we wanted to reach the `bike_share.csv` file from the `worksheet_02` folder, we could
126
-
use the relative path `../tutorial_01/bike_share.csv`. We can even combine these two; for example, we could reach the `bike_share.csv` file using
127
-
the (very silly) path `../tutorial_01/../tutorial_01/./bike_share.csv` with quite a few redundant directions: it says to go back a folder, then open `tutorial_01`,
128
-
then go back a folder again, then open `tutorial_01` again, then stay in the current directory, then finally get to `bike_share.csv`. Whew, what a long trip!
125
+
the previous directory with two dots `..`. \index{aaaaaprevdirsymb@\texttt{..}|see{path}} So for instance, if we wanted to reach the `bike_share.csv` file from the `project3` folder, we could
126
+
use the relative path `../project2/bike_share.csv`. We can even combine these two; for example, we could reach the `bike_share.csv` file using
127
+
the (very silly) path `../project2/../project2/./bike_share.csv` with quite a few redundant directions: it says to go back a folder, then open `project2`,
128
+
then go back a folder again, then open `project2` again, then stay in the current directory, then finally get to `bike_share.csv`. Whew, what a long trip!
129
129
130
130
So which kind of path should you use: relative, or absolute? Generally speaking, you should use relative paths.
131
131
Using a relative path helps ensure that your code can be run
@@ -136,17 +136,17 @@ all of the folders between the computer's root, represented by `/`, and the file
136
136
across different computers. For example, suppose Fatima and Jayden are working on a
137
137
project together on the `happiness_report.csv` data. Fatima's file is stored at
0 commit comments