R: Write Data into ARFF Files

write.arff {foreign} | R Documentation

## 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

Attribute-Relation File Format http://www.cs.waikato.ac.nz/~ml/weka/arff.html
http://weka.sourceforge.net/wekadoc/index.php/en:ARFF_(3.5.1)

### See Also

`read.arff`

### Examples

    write.arff(iris, file = "")

[Package foreign version 0.8-50 Index]