I want to calculate mean and sd from column in dataframe. This column contain NA, and Inf value.
This is some example of value in this column
value
0.9343113
0.8339523
0.0000000
NaN
Inf
I try to use apply function but it give an error message
mean=apply(am_bp$foldchange_so,2,FUN=function(x){mean(x,na.rm=T)})
Error in apply(am_bp$foldchange_so, 2, FUN = function(x) { : dim(X) must have a positive length
Then I try mean=colMeans(matrix(am_bp$foldchange_so),na.rm=TRUE)
but it give inf value
Moreover, I don't know how to calculate sd in the column
How should I solve this problem