I’m pretty new to coding–so I apologize if this question doesn’t make sense! Happy to add more context.
I’m trying to create an Renviron file to create a path to a shared data folder for collaborators to be able to load the same data in my R script. I have successfully created an .Renviron file, but when I try to save a data frame it claims that the .csv file I’m trying to load does not exist. My code is saved in a separate folder (proposal) within a parent folder from my data, which is saved in the data folder. The Renviron file is saved in the parent folder.
Does anyone have any ideas for what to do next to try to fix this so that any collaborators can load the data? Thanks in advance for your help!
Here is my Renviron file code:
vector_box_path = '/Users/firstlast/Library/CloudStorage/Box-Box/data_viz_final_hv/data/'
Here is the code where I’m trying to load my file:
box_path = Sys.getenv("vector_box_path")
vectors_group <- read_csv(paste(box_path, "filename.csv", sep = "/"))
This is where I get the following error message:
Error: ‘/filename.csv’ does not exist.
I’ve already tried adjusting the /’s in my Renviron file (so both data/ and data without the / but adding the / to my filename.csv path. So, “/filename.csv” instead of “filename.csv”.
user26806386 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.