What I did now is that I checked the class of both matrix before assigning the first row of mat2: class(mainMat) --> "matrix" class(mainMat[1,]) --> "list" class(mat2) --> "matrix" mat2[1,]<-mainMat[1,] class(mat2) --> "list" I think the problem comes from mainMat[1,] that should be of class "matrix" but is of class "list"...
----- Anna Lippel -- View this message in context: http://n4.nabble.com/Simple-question-on-replace-a-matrix-row-tp1427857p1437234.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.