Hi r-users,

I have a matrix B and a list of 3x3 matrices (mylist). I want to
calculate the quantiles in the list using each of the value of B as
probabilities.

 

The codes I wrote are:

 

B <- matrix (runif(12, 0, 1), 3, 4)

mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)})

 

for (i in 1:length(B))

{

  quant <- lapply (mylist, quantile, probs=B[i])

}

 

But quant returned the quantiles calculated using only the last value
([3,3]) of the matrix B.

 

What am I doing wrong?

 

Thank you for your help

Lorenzo


	[[alternative HTML version deleted]]

