[R] matrix with additional upper, botton, left and right cells

2006-09-26 Thread Milton Cezar
Dear R Gurus, I have a matrix dim(1000x1000) and I need create a second matrix with dim(1002x1002) and insert my first matrix at position col=2,line=2. Please, see an example below: 0050055050 555000 5000505005 5005000500 000555 and I need

Re: [R] matrix with additional upper, botton, left and right cells

2006-09-26 Thread jim holtman
How about something like this: x - matrix(1:100,10) x.1 - array(-3, dim=c(12,12)) x.1[2:11, 2:11] - x x.1 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -3 -3 -3 -3 -3 -3 -3 -3 -3-3-3-3 [2,] -31 11 21 31 41 51 61 71