RWeka read.arff 问题
我正在使用 RWeka 包的 read.arff 方法读取(稀疏)arff。但是我收到以下错误:
Error in .jnew("java/io/FileReader", file) :
java.io.FileNotFoundException: (No such file or directory)
我尝试读取的文件存在(file.exists('myfile.arff')返回TRUE)。
我的一行代码是:
data = read.arff(system.file('arff', 'myfile.arff', package='RWeka'))
有什么想法可能会发生什么吗?
谢谢。
编辑1:traceback()输出
> 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"))
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"))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在使用
help(read.arff)
中示例的格式,但不理解为什么它是使用 system.file() 函数编写的。如果您的 .arff 文件不在包目录中(并且它看起来并不位于该目录中),那么您不应该使用该函数。尝试一下:或者如果它在您的工作目录中,则可能只是这样:
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:Or maybe just this if it is in your working directory: