Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Rita Carreira
I assume that you are working in package MatrixCalc. Let’s say you have a matrix X. You can call the columns of X this way: X[,1] for the first column X[,2] for the second column X[,3] for the third column Etc. So let’s say that you want to add the first and third column, then you would just

Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Gabor Grothendieck
On Wed, Jun 22, 2011 at 2:35 AM, Nabila Binte Zahur wrote: > Dear Sirs/Madam, > > I am a beginner to R, and I am currently working on a data matrix which looks > like this: > >> head(oligo) > >        ko:K1 ko:K3 ko:K5 ko:K8 ko:K9 ko:K00010 ko:K00012 > AAA       370          6

Re: [R] Help Needed on Merging Columns by Summation

2011-06-22 Thread Dennis Murphy
Hi: Based on the information you provided, I would suggest looking into the transform() and within() functions in base R, and perhaps the mutate() function in package plyr. HTH, Dennis On Tue, Jun 21, 2011 at 11:35 PM, Nabila Binte Zahur wrote: > Dear Sirs/Madam, > > I am a beginner to R, and I