Last data update: 2014.03.03

R: Writes Matrix Data to a File
mat.writeR Documentation

Writes Matrix Data to a File

Description

Matrix data are written to a specified output file.

Usage

mat.write(mat, file.name, ij = FALSE, sym = FALSE, sparse=FALSE, formatted=TRUE)

Arguments

mat

matrix which should be written

file.name

file name

ij

logical, if TRUE the format in the file will be: iquad jquad value, otherwise each row of the file represents one row in the matrix

sym

logical, if TRUE the matrix is symmetric, only important if ij = TRUE

sparse

logical, if TRUE the matrix is written in sparse format (e.g. only non-zero values are written to the file), only important if ij = TRUE

formatted

logical, if TRUE a blank line is inserted after all entries of one row, only important if ij = TRUE

Details

In general there are two ways the output file can be written. First the matrix can be written to the file as write.table does and second the file can be written with the form: iquad jquad value, this means the value at position [i,j]. If the latter by ij = TRUE is selected, three more options can be chosen. If sym = TRUE the output file just contains the upper triangle and the diagonal of the matrix. If spase = TRUE only non-zero values are written. If formatted = TRUE a blank line seperates the entries of different rows.

Value

No values are returned.

Author(s)

Philipp Weil

See Also

mat.read

Results