If you want a large matrix but with only a few unique values, take advantage of R's ability to recycle input.
matrix(c(4),nrow=3, ncol=10)
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
## [1,] 4 4 4 4 4 4 4 4 4 4
## [2,] 4 4 4 4 4 4 4 4 4 4
## [3,] 4 4 4 4 4 4 4 4 4 4
Note the matrix is filled up by column (i.e. first element goes to row 1 column 1, second element goes to row 2, column 1, etc.)
matrix(c(4,0), nrow=2, ncol=10)
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
## [1,] 4 4 4 4 4 4 4 4 4 4
## [2,] 0 0 0 0 0 0 0 0 0 0