[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 
   
  
  300500550503
  35550003
  350005050053
  350050005003
  30005553
  
   
  Thanks a lot, 
   
  miltinho

 __


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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   718191-3
 [3,]   -32   12   22   32   42   52   62   728292-3
 [4,]   -33   13   23   33   43   53   63   738393-3
 [5,]   -34   14   24   34   44   54   64   748494-3
 [6,]   -35   15   25   35   45   55   65   758595-3
 [7,]   -36   16   26   36   46   56   66   768696-3
 [8,]   -37   17   27   37   47   57   67   778797-3
 [9,]   -38   18   28   38   48   58   68   788898-3
[10,]   -39   19   29   39   49   59   69   798999-3
[11,]   -3   10   20   30   40   50   60   70   8090   100-3
[12,]   -3   -3   -3   -3   -3   -3   -3   -3   -3-3-3-3


On 9/26/06, Milton Cezar [EMAIL PROTECTED] wrote:
 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

  
  300500550503
  35550003
  350005050053
  350050005003
  30005553
  

  Thanks a lot,

  miltinho

  __


[[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.