-3

I'm new to R and still learning. I have a matrix with 100 columns and I need to calculate the average of each column and store all those values for further calculations. Each column has 5 numbers and after this step i'm supposed to have 100 new values. Also, please let me know if the replicate() function is a viable way to do this in just one line.

1 Answers1

5
colMeans(DF)

Is a highly optimized function for exactly this purpose.

De Novo
  • 7,120
  • 1
  • 23
  • 39