arodi, Pietro"
Cc: "r-help@r-project.org"
Sent: Saturday, June 8, 2013 9:49 AM
Subject: Re: [R] Help with multiple use of "quantile"
Try this, Pietro ...
# example data
aaa <- matrix(rnorm(60), ncol=3)
bbb <- matrix(runif(15), ncol=3)
# calculate quantiles
identical(ccc,ccc1)
#[1] TRUE
A.K.
- Original Message -
From: "Adams, Jean"
To: "Parodi, Pietro"
Cc: "r-help@r-project.org"
Sent: Saturday, June 8, 2013 9:49 AM
Subject: Re: [R] Help with multiple use of "quantile"
Try this, Pietro ...
#
Try this, Pietro ...
# example data
aaa <- matrix(rnorm(60), ncol=3)
bbb <- matrix(runif(15), ncol=3)
# calculate quantiles
ccc <- sapply(1:dim(aaa)[2], function(i) quantile(aaa[, i], bbb[, i]))
# change rownames
rownames(ccc) <- seq(dim(ccc)[1])
Jean
On Sat, Jun 8, 2013 at 8:20 AM, Parodi, Pi
Hello
I have a matrix aaa like this:
aa1 aa2 aa3
[1,] 8371.417 27613.57 1170.466
[2,] 14317.999 42421.82 3423.934
[3,] 22026.466 59874.14 8103.084
[4,] 33884.986 84506.34 19176.764
[5,] 57954.968 129824.30 56097.310
where each column represents an empirical distrib
4 matches
Mail list logo