Trouble analyzing csv file

Hello I am new to R and am having trouble analyzing a csv (homework assignment file). I downloaded the file as csv, imported it and tried to create a data frame and keep getting an error message. What am I missing?

PesticideData <- read.csv("~/PesticideData.csv")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'PesticideData.csv': No such file or directory


PesticideData <- read.csv("~/PesticideData.csv")

is not giving you an error, then the data are being read into a data frame named PesticidedData. If that is giving you a error, try writing out the entire path to the file. On my systems that would be either

#Linux system
PesticideData <- read.csv("/home/fjcc/R/PesticideData.csv")


#Windows system
PesticideData <- read.csv("c:/users/fjcc/Documents/R/PesticideData.csv")

but you have to know where the file is.

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