I have a county data.R
script where I am creating my primary df and a methods.Rmd
where I would like to use that df. I would like to use the relative paths from my project and the getwd()
confirmed the path, instead of creating a working directory like here, and it was correct. I was largely working off this tutorial. What am I missing here?
That script begins by loading the root data using the following.
county data.R
# read file
tf <- read.delim('data/cdc/suicide2017.txt')
If I run county data.R
script by itself, tf
is created fine. If I run the following in methods.Rmd
I get an error.
methods.Rmd
```{r}
source('./county data.R')
source('./reference.R')
head(tf)```
Error:
cannot open file './data/cdc/suicide2017.txt': No such file or directoryError in file(file, "rt") : cannot open the connection
EDIT: Directory structure
-myproject
-r/
--scripts/
---county data.R
---methods.Rmd
-data/
--cdc/
---suicide2017.txt