Displaying 1 result from an estimated 1 matches for "cov_25".
Did you mean:
cov2
2011 Dec 08
2
Behavior of apply()
...[2,] 6.7312928 5.719641
I then use the following function via apply and get the desired output, a list
signif <- function(x) which(abs(x) > 1.96)
apply(cov_50, 1, signif)
> apply(cov_50, 1, signif)
[[1]]
[1] 2
[[2]]
[1] 1 2
However, I can't see why the following occurs
> class(cov_25)
[1] "matrix"
> cov_25
[,1] [,2]
[1,] 12.116106 14.81248
[2,] 5.492176 4.73138
> apply(cov_25, 1, signif)
[,1] [,2]
[1,] 1 1
[2,] 2 2
So, using the same function (signif) on a different object of the same class yields a matrix and *not* a list as...