read.csv is not responding

Cannot read a CSV file. the below error is shown. how do I progress?

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'pupae.csv': No such file or directory

The important clue is where the error message says "No such file or directory". R cannot find the file. Are you sure you have typed the name correctly? Have you checked whether the working directory is correct with

getwd()

Have you tried using the full path to the file rather than just the file name or a relative path?

Seeing the actual command you are using would help someone help you.

getwd()
[1] "/Users/sunayanasajith/Desktop/Data"
dir()
[1] "16th sept.R" "Allometry.csv" "pupae.csv" "Rain.csv"
dir(pattern='[.]csv, ignore.case=TRUE')
character(0)
dir(pattern="[.]csv", ignore.case=TRUE)
[1] "Allometry.csv" "pupae.csv" "Rain.csv"
allom<- read.csv("Allometry.csv")

It works now. I have no idea what worked. I just re-started rstudio

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.