For a matrix with N columns, write_matrix() and read_matrix(N) are thought to be mutual inverse.

write_matrix(mat, file)

Arguments

mat

matrix to be written

file

file to write to

See also

Examples

m <- matrix(1:6, ncol = 3) tf <- tempfile() write_matrix(m, tf) rm3 <- read_matrix(3) rm3(tf)
#> [,1] [,2] [,3] #> [1,] 1 3 5 #> [2,] 2 4 6