So I made a new project for a case study. Put it in my projects folder on my desktop. Put a data folder in there containing 40 .csv files. Now what I'm trying to do is set the directory and aggregate all the data using map_df.
However I'm running into an issue where my permission is being denied?
Here is my code:
install.packages("tidyverse")
library(tidyverse)
bs_csv_file_dir <- "C:/Users/fakename/Desktop/Projects/BikeShare_MemberAnalysis/Cyclistic Data/202004-202307_Cyclistic"
bs_csv_files <- list.files(path = bs_csv_file_dir, pattern = ".csv")
bs_csv_data <- map_df(bs_csv_files, ~read_csv(file.path(bs_csv_file_dir)))
and the error message is:
Error in `map()`:
ℹ In index: 1.
Caused by error in `file()`:
! cannot open the connection
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In file(con, "rb") :
cannot open file 'C:/Users/fakename/Desktop/Projects/BikeShare_MemberAnalysis/Cyclistic Data/202004-202307_Cyclistic': Permission denied