99 102 3 12 43 213.0 12 12 2 23 21 211
> A <- matrix(scan("~/matrix.dat", n = 3*4), 3, 4, byrow = TRUE)
Read 12 items
> A
[,1] [,2] [,3] [,4]
[1,] 99 102 3 12
[2,] 43 213 12 12
[3,] 2 23 21 211
> A <- as.matrix(read.table("matrix.dat"))
> A
V1 V2 V3
[1,] 99 102 3
[2,] 12 43 213
[3,] 12 12 2
[4,] 23 21 211
原文:http://my.oschina.net/letiantian/blog/324257