readARFF: Read ARFF file into data.frame.

Description Usage Arguments Details Value Note Examples

View source: R/readARFF.R

Description

Implementation of a fast ARFF parser that produces consistent results compared to the reference implementation in RWeka. The “DATA” section is read with read_delim.

Usage

1
2
3
4
5
6
7
8
readARFF(
  path,
  data.reader = "readr",
  tmp.file = tempfile(),
  convert.to.logicals = TRUE,
  show.info = TRUE,
  ...
)

Arguments

path

[character(1)]
Path to ARFF file with read access.

data.reader

[character(1)]
Package back-end to parse ARFF data section with. At the moment only readr is supported. Default is “readr”.

tmp.file

[character(1)]
The ARFF file must be preprocessed a bit, before it can be fed to the data.reader. Path to TEMP output file, where this result is stored. The file is deleted on exit. Default is tempfile().

convert.to.logicals

[logical(1)]
Should factors with values T or F be converted to logicals? (RWeka does this by default). Default is TRUE.

show.info

[logical(1)]
Default is TRUE

...

[any] Further parameters passed to read_delim.

Details

ARFF parsers are already available in package RWeka in read.arff and package foreign in read.arff. The RWeka parser requires Java and rJava, a dependency which is notoriously hard to configure for users in R. It is also quite slow. The parser in foreign in written in pure R, slow and not fully consistent with the reference implementation in RWeka.

Value

[data.frame].

Note

Examples

1
2
3
path = tempfile()
writeARFF(iris, path = path)
d = readARFF(path)

Example output

Parse with reader=readr : /work/tmp/tmp/Rtmp5qxTtB/file448b400c8f0d
Loading required package: readr
header: 0.006000; preproc: 0.000000; data: 0.086000; postproc: 0.000000; total: 0.092000

farff documentation built on May 11, 2021, 1:06 a.m.

Related to readARFF in farff...