您还可以使用:
t <- readLines(textConnection("0000010000010000000101000001000000011000000001
0000000000000000000000010001000001001000110001
0000100000000000000000010000000000000000010100
0100000001100000000001001001100000010000000001
0001000000000100010000010000000000010000000000"))
do.call("rbind", lapply(strsplit(t, ""), as.numeric))
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0 0 0 0 0 1 0 0 0 0 0 1 0 0
[2,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0 0 0 1 0 0 0 0 0 0 0 0 0
[4,] 0 1 0 0 0 0 0 0 0 1 1 0 0 0
[5,] 0 0 0 1 0 0 0 0 0 0 0 0 0 1
[,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
[1,] 0 0 0 0 0 1 0 1 0 0 0 0
[2,] 0 0 0 0 0 0 0 0 0 1 0 0
[3,] 0 0 0 0 0 0 0 0 0 1 0 0
[4,] 0 0 0 0 0 0 0 1 0 0 1 0
[5,] 0 0 0 1 0 0 0 0 0 1 0 0
[,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38]
[1,] 0 1 0 0 0 0 0 0 0 1 1 0
[2,] 0 1 0 0 0 0 0 1 0 0 1 0
[3,] 0 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 1 1 0 0 0 0 0 0 1 0 0
[5,] 0 0 0 0 0 0 0 0 0 1 0 0
[,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46]
[1,] 0 0 0 0 0 0 0 1
[2,] 0 0 1 1 0 0 0 1
[3,] 0 0 0 1 0 1 0 0
[4,] 0 0 0 0 0 0 0 1
[5,] 0 0 0 0 0 0 0 0