[ESS] problems with generation of quantiles under For ()

Agustín Muñoz M. (AMFOR) agustin at terra.cl
Sun May 16 23:34:51 CEST 2010


Dear, I want to make an application to calculate quantile within a For()

I tried the following without success:

ej.

date 

p_val

x1	x2	x3	x4	x5
2	5	7	5	3
3	8	4	8	2
8	5	2	0	6
3	5	9	5	1
5	1	7	8	4
.	.	.	.	.
.	.	.	.	.
n	n	n	n	n



test 1
rr <- paste("p_val$",names(p_val[1]), sep="")  
quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100)/100, na.rm=FALSE, type=1)

test 2
rr <- noquote(paste("p_val$",names(p_val[1]), sep=""))  
quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100)/100, na.rm=FALSE, type=1)

test 3
quant <- quantile(p_val[1], probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80,
90, 100)/100, na.rm=FALSE, type=1)


The only thing that works for me is:

quant <- quantile(p_val$X1, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80,
90, 100)/100, na.rm=FALSE, type=1)

but the evil, he will not let me do this for a dynamic For()


I hope I can help, as they always do.

from now, thank you very much.

Atte.

Agustín



More information about the ESS-help mailing list