write.arff: Writes data to ARFF

Description Usage Arguments Examples

View source: R/rmcfs.io.R

Description

Exports data into ARFF format. This format is used by Weka Data Mining software http://www.cs.waikato.ac.nz/ml/weka/.

Usage

1
write.arff(x, file = "", target = NA, chunk_size=100000, zip = FALSE)

Arguments

x

data frame with data

file

exported filename

target

sets target attribute in ARFF format. Default value is NA what refers to the last column.

chunk_size

it defines size of chunk (number of cells) that are processed and exported. The bigger the value, the function is faster for small data and slower for big data.

zip

whether to create zip archive.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  ## Not run: ###dontrunbegin

  # create artificial data
  adata <- artificial.data(rnd_features = 1000)
  
  #Fix input data to be consistent with ARFF and ADX formats. 
  #It is not necessary but for some data can help to export in proper format.
  adata <- fix.data(adata)
  write.arff(adata, file = file.path(tempdir(), "adata.arff"), target = "class")
  
  
## End(Not run)###dontrunend

rmcfs documentation built on Sept. 18, 2021, 5:07 p.m.

Related to write.arff in rmcfs...