I have a dataframe in the following format (numeric columns with the first row corresponding to some name; data can be missing)-
col1.name | col2.name | col3.name | ... 132 | 12.1 | NA | ... 12.4 | NA | 14.6 | ... 13 | 1441 | 535 | ...
For each column, I want to calculate it's mean, median, and standard deviation and add them to a dataframe in the format-
col.name | mean | median | sd col1.name | 123 | 456 | 12.2 col2.name | 12.1 | 45 | 32.1 col3.name | 111 | 14.6 | 69.2 ... | ... | ... | ...
I currently have the following code; but it gives me an error on 'x' must be numeric. What can I do to do this?
data.frame(ID=hvbp.analysis.df[,1], Means=rowMeans(hvbp.analysis.df[,-1]))
apply(hvbp.analysis.df, 2, mean, na.rm = TRUE)