In R: How do I perform a log operation on every element of a matrix without using a loop?
I have a matrix m and I want each element to be replaced by its log.
log(m) doesn’t work.
params = array(list(),c(2, 2))
then I manually set all elements.
params
[,1] [,2]
[1,] 3 3
[2,] 3 3
log(params)
Error in log(params) : Non-numeric argument to mathematical function
log(M)works for all of us on correct matrices:Can you show us your
M?