0

This is my question if i input this to my R data Mining tool

mydata <- read.csv("filename.txt")

it will shows an error like below

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

what can i do to clear this error

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
  • 1
    try to give full path like c://abce//thk//filename.tx – prashant thakre Aug 11 '14 at 04:24
  • 1
    @Devi Ganesh. Do you have the file in the working directory? check `getwd()` and also `list.files()`. If the file is in other directory, `setwd(path_to_file)` is one option or use `read.csv(file.choose())` – akrun Aug 11 '14 at 04:24
  • 1
    Have you done any searching? A quick glance throws up http://stackoverflow.com/questions/5568847/how-to-open-csv-file-in-r-when-r-says-no-such-file-or-directory http://www.researchgate.net/post/Can_anybody_explain_why_R_cannot_read_a_certain_file – Roman Luštrik Aug 11 '14 at 05:54

1 Answers1

0

Use read.delim("Path of the file like C://Users//Desktop//filename.txt")

which has more options than read.csv

user3619015
  • 176
  • 1
  • 1
  • 9