I have a numeric data matrix that looks like below:
(Matrix)
Sample1 Sample2 Sample3 Sample4
BD.1809 0.4275 -1.034 0.857757 -1.43362
BD.911 0.4455 -1.456 -0.472828 -0.643979
BP.12 0.03642 -0.9054 1.03334 -0.02428
BS.114 -0.3262 4.677 -0.92514 -0.2435
BS.130 -0.2335 -0.8661 -1.21435 -0.9759
BS.376 0.1937 -1.043 -0.320004 -0.691325
I have calculated the mean with the following code Mean<-mean(Matrix)
How would I replace each value in the matrix with the Mean?
can any one give me tips on how to do this? The row and column names are unknown as are the values themselves and the size of the matrix.
1 Answer