I am learning R Notebook currently and I am having a path problem. I have made an R project and hosted all of my scripts and files in a folder containing the R project. I am trying to run:
Next, install libraries:
library(tidyverse)
library(CHNOSZ)
library(janitor)
Then import and merge the files using:
d <-list.files(path="./merge", pattern="*.csv", full.names = TRUE) %>%
map_df(~read_csv(., col_types = cols(.default = "c")))
d
and the result is a tibble with 0 rows. Also,
write.csv(d,file="data_generated/FinalmergeAllCompounds_comb.csv")
throws the error Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
When I run this as a normal script within the same project in Rstudio the script works just fine. I merge the .csv files without an issue and I can export it back out into my project directory with no problems.
It seems to be a conflict between RNotebook and the file path. How do I fix this?