如何使用R将data.frame写入arff [英] How to write data.frame into arff using R
本文介绍了如何使用R将data.frame写入arff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Weka可以读取csv文件,但是,如果csv文件的格式不能完全满足Arff文件标准,则可能会引起一些问题。例如,我发现将时间序列CSV文件加载到Weka会反复导致错误。
Weka can read csv files, however, if csv file's format is not fully satisfy Arff file standard, it may cause some problem. For example, I found loading a time series CSV file to Weka cause errors repeatedly.
有一些关于使用python在线将csv转换为arff的帖子,但是我认为代码有点冗长,而且并不总是有效。
There have been some posts on using python to convert csv to arff online, but I think the code is a little lengthy and not always work.
是否有更安全快捷的方法将Rs中的csv转换为arff?
Is there a safer and quick way to convert csv to arff in R?
推荐答案
简单,请使用软件包RWeka
Simple, use the package RWeka
library(RWeka)
write.arff(iris, file = "iris.arff")
这篇关于如何使用R将data.frame写入arff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文