On Jan 29, 2010, at 3:55 PM, anna wrote:
Hello, I have a matrix mat1 of dim [1,8] and mat2 of dim[30,8], I
want to
replace the first row of mat2 with mat1, this is what I do:
mat2[1,]<-mat1 but it transforms mat2 in a list I don't understand,
I want
it to stay a matrix...
What makes you think mat1 was a matrix to begin with?
> mat1 <- matrix(8:1, 1,8)
> mat2 <-matrix(1:(8*8), 8,8)
> mat2[1,] <- mat1
> mat2 # an 8 x 8 matrix
We cannot tell what sort of errors you are making (since your provided
no reproducible example), but you surely are making errors.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
R-help@r-project.org 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.