Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write.arff

Write Data into ARFF Files


Description

Writes data into Weka Attribute-Relation File Format (ARFF) files.

Usage

write.arff(x, file, eol = "\n", relation = deparse(substitute(x)))

Arguments

x

the data to be written, preferably a matrix or data frame. If not, coercion to a data frame is attempted.

file

either a character string naming a file, or a connection. "" indicates output to the standard output connection.

eol

the character(s) to print at the end of each line (row).

relation

The name of the relation to be written in the file.

Details

relation will be passed through make.names before writing to the file, in an attempt to it them acceptable to Weka, and column names what do not start with an alphabetic character will have X prepended.

However, the references say that ARFF files are ASCII files, and that encoding is not enforced.

References

See Also

read.arff; functions write.arff and read.arff in package RWeka which provide some support for logicals via conversion to or from factors.

Examples

write.arff(iris, file = "")

foreign

Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat', 'Weka', 'dBase', ...

v0.8-81
GPL (>= 2)
Authors
R Core Team [aut, cph, cre], Roger Bivand [ctb, cph], Vincent J. Carey [ctb, cph], Saikat DebRoy [ctb, cph], Stephen Eglen [ctb, cph], Rajarshi Guha [ctb, cph], Swetlana Herbrandt [ctb], Nicholas Lewin-Koh [ctb, cph], Mark Myatt [ctb, cph], Michael Nelson [ctb], Ben Pfaff [ctb], Brian Quistorff [ctb], Frank Warmerdam [ctb, cph], Stephen Weigand [ctb, cph], Free Software Foundation, Inc. [cph]
Initial release
2020-12-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.