Community
I've started using R Projects (really like them) but I have an issue understanding setting up my working dir in R Notebooks within a R Project.
I set my working dir in my setup R chunk as follows:
knitr::opts_knit$set(root.dir ="../")
And then when I deed to call a data set from my Data dir in the R projects I'll use something like
my_Dat <- read.csv("Data/mydata.csv")
which only seems to work when i knit the file. if I try running the code separately within the R Notebook I get an error
Error in file(file, "rt") : cannot open the connection
But if I change the code to my_Dat <- read.csv("../Data/mydata.csv") I can run the chunk, but then when I try and knit the code I get the following error
Line xxx Error in file(file, "rt") : cannot open the connection
Calls: ... withVisible -> eval -> eval -> read.csv -> read.table -> file
Execution halted
So what am I doing wrong??
Jeff