writeSparseData: Write given (dense) R matrix and R vector in sparse (LIBSVM)...

Description Usage Arguments Value Note Examples

Description

Write given (dense) R matrix and R vector in sparse (LIBSVM) format to given file.

Usage

1
2
writeSparseData(filename, X, Y, append = FALSE, skipBytes = 0L,
  verbose = FALSE, zeroBased = FALSE)

Arguments

filename

the filename to write the given data to

X

The data to write as a matrix

Y

The labels for the data.

append

Append to the file (or overwrite)?

skipBytes

How many bytes of the head of the files should be skipped?

verbose

Be verbose?

zeroBased

Do the indices in the file start with 0, e.g. -1 0:2 1:4 ...?

Value

NULL.

Note

Labels can any numeric, they are not converted in any way.

Examples

1
2
3
	X = as.matrix(iris[,1:4])
	Y = as.matrix(as.numeric(iris[,5]))
	writeSparseData ("./australian.data", X, Y)

aydindemircioglu/SVMBridge documentation built on May 11, 2019, 4:13 p.m.