I am reading a (sparse) arff using read.arff method of RWeka package. However I get the following error:
Error in .jnew("java/io/FileReader", file) :
java.io.FileNotFoundException: (No such file or directory)
The file I am trying to read in exists (file.exists('myfile.arff') return TRUE).
My one line code is:
data = read.arff(system.file('arff', 'myfile.arff', package='RWeka'))
Any ideas what might be going on?
Thanks.
Edit 1: traceback() output
> traceback()
4: stop(list(message = "java.io.FileNotFoundException: (No such file or directory)",
call = .jnew("java/io/FileReader", file), jobj = <S4 object of class "jobjRef">))
3: .External("RcreateObject", class, ..., silent = silent, PACKAGE = "rJava")
2: .jnew("java/io/FileReader", file)
1: read.arff(system.file("arff", "/home/andy/r/myfile.arff",
package = "RWeka"))
You seem to be using the format of the example in help(read.arff)
without understanding why it is written using the system.file() function. If your .arff file is not in the package directory (and it does not appear to be so located), then you should not be using that function. Try instead:
mydat <- read.arff(file= "/home/andy/r/myfile.arff")
Or maybe just this if it is in your working directory:
mydat <- read.arff(file= "myfile.arff")