Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread arun
NA NA SumMatrix   SUM 57 64 65 CountMat  COUNT  3  3  3 names(NewMatrix1) NULL I guess then it will be better to store as matrix. A.K. - Original Message - From: Jean V Adams To: Rantony Cc: r-help@r-project.org Sent: Thursday, July 12, 2012 8:42 AM Subject: Re: [R] Add row into a Matrix

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread arun
ot; > NewMatrix1<-data.frame(NewMatrix1) A.K. ----- Original Message ----- From: Rantony To: r-help@r-project.org Cc: Sent: Thursday, July 12, 2012 1:22 AM Subject: [R] Add row into a Matrix witout headers from Function Hi, Here i have a matrix like this, OLDMatrix <- X1        X2   

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Rantony
Thanks jean. From: Jean V Adams [via R] [mailto:ml-node+s789695n4636289...@n4.nabble.com] Sent: Thursday, July 12, 2012 6:14 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Add row into a Matrix witout headers from Function Try using the rbind() function to combine the two vectors f

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Jean V Adams
Try using the rbind() function to combine the two vectors from colSums() into a matrix. Then assign row names and get rid of column names using the dimnames() function. For example: OLDMatrix <- matrix(c(22, 25, 10, 24, 27, 13, 23, 27, 15), ncol=3, dimnames = list(NULL, c("X1", "X2",

[R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Rantony
Hi, Here i have a matrix like this, OLDMatrix <- X1 X2X3 - ---- 22 24 23 25 27 27 10 13 15 the thing is, im running two function(SUM,COUNT) to get output in another matrix called NEWMatrix NEWMatrix <- c("SUM