Hi,

 

I have the following matrix

 

cc <- matrix (1:21, 3)

cc[,3:4]<- 0

cc

     [,1] [,2] [,3] [,4] [,5] [,6] [,7]

[1,]    1    4    0    0   13   16   19

[2,]    2    5    0    0   14   17   20

[3,]    3    6    0    0   15   18   21

 

and I would like to sum just the values in columns 2, 3 and 4, so to
have something like

 

1  4  13  16  19

2  5  14  17  20

3  6  15  18  21

 

Thanks 

 

Lorenzo


	[[alternative HTML version deleted]]

