Learn R Programming

BioPhysConnectoR (version 1.6-10)

mat.read: Read Matrix Data from a File

Description

A matrix is constructed from a specified input file.

Usage

mat.read(file.name, ij = FALSE, sym = FALSE)

Arguments

file.name
file name
ij
logical, if TRUE the format in the file is: $i\quad j\quad 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

Value

Return value is the matrix.

Details

There are two ways a matrix can be specified in the input file. If each line represents a row in the matrix (default), the matrix can simply be read. Otherwise it is possible to have an input file with the form: $i\quad j\quad value$, this means the value at position $[i,j]$ of the matrix is set to $value$. If ij = TRUE and sym = TRUE only one half of the matrix needs to be provided.