Re: [R] replace a row in a matrix

2010-11-14 Thread John Kane
Indexing (xx <- matrix(1:4, nrow=2)) vec <- 5:6 xx[2,] <- vec xx --- On Sun, 11/14/10, cassie jones wrote: > From: cassie jones > Subject: [R] replace a row in a matrix > To: r-help@r-project.org > Received: Sunday, November 14, 2010, 10:59 AM > Dear all, > > > I created a n*2 matrix and

Re: [R] replace a row in a matrix

2010-11-14 Thread Joshua Wiley
Hi Cassie, If your matrix is named "X", and your vector "y", then: X[i, ] <- y Please read the documentation for the extraction operator. You can pull this up by entering the following command at the R console: ?"[" You would also probably benefit from a careful reading of this manual: http:/