Hello everyone,
I am Emmanuel Katto and I'm currently working on a project using R Markdown in Posit and facing an issue while trying to import a CSV file into my R script. The code I’m using is as follows:
data <- read.csv("path/to/my/datafile.csv")
However, I keep getting the following error message:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'path/to/my/datafile.csv': No such file or directory
I've double-checked the file path and ensured that the CSV file exists in the specified location. I'm running this on Posit Cloud, and I'm not sure if there's a different way to reference file paths in this environment.
Could anyone provide guidance on how to properly import data files in R Markdown while using Posit? Are there any best practices or alternative methods to consider?
Thank you in advance for your help!
Emmanuel Katto