In R: How to perform a log operation for each matrix element without using a loop?
I have a matrix m, and I want each element to be replaced by its log. log (m) does not work.
params = array(list(),c(2, 2))
then I manually set all the elements.
params
[, 12]
[1,] 3 3
[2,] 3 3
log(params)
Error in log (params): non-numeric argument for math function
source
share