Read in a matrix from a file

Description

Reads in a matrix from file (no header, no row-names, no NA's, space or tab-delimiter) and returns the according R-matrix. No Need to specify dimensions.

Usage

1
cscanx(path)	

Arguments

path

character - location of the file to be read ("/path/to/file")

Value

Matrix shaped as in the file

Examples

1
2
3
4
5
6
7
8
# random matrix
X <- matrix(rnorm(10,5),10,5)

# write that matrix to a file
write.table(X,file="X",col.names=FALSE,row.names=FALSE,quote=FALSE)

# read in the matrix to object Z
Z <- cscanx("X")