Sum of columns in maM (marrayNorm) in R

I have to admit I'm new to R, so I really need help here.

I have a marrayNorm object from the marray library (on the bioconductor), after normalizing 12 arrays with 13640 points each. Now I need to convert my 12 columns to 6 columns, adding up each of the two normalized data columns.

start with maM(marrayNorm) :

  **abcd** ... (up to 12 columns) 1 2 3 4 5 6 7 8 9 10 11 12 

... 13640 lines

ends with:

 **ab cd** 3 7 11 15 19 23 
+4
source share
1 answer
 result <- cbind(maM(marrayNorm)[, 1] + maM(marrayNorm)[, 2], maM(marrayNorm)[, 3] + maM(marrayNorm)[, 4], maM(marrayNorm)[, 5] + maM(marrayNorm)[, 6], maM(marrayNorm)[, 7] + maM(marrayNorm)[, 8], maM(marrayNorm)[, 9] + maM(marrayNorm)[, 10], maM(marrayNorm)[, 11] + maM(marrayNorm)[, 12]) 
0
source

Source: https://habr.com/ru/post/1438725/


All Articles