Hi all,
I am running into a snag using quantile function in stats. Basically, I
don't understand why the loop below throws the error that it does.
test.data <- rnorm(1000, 0, 1)
for (i in seq(0.00001, 0.001, 0.00001)){
test <- quantile(test.data, probs=seq(0,1,i));
print(i);
}
It runs fine from 1e-05 to 0.00024, but then throws the error
Error in quantile.default(test.data, probs=seq(0,1,i)):
'probs' outside [0,1]
I tested it some more by using
test <- quantile(test.data, probs=seq(0,1,0.00024));
test <- quantile(test.data, probs=seq(0,1,0.00025));
both ran fine. So, I'm baffled as to what the error actually is.
My sessionInfo() is:
R version 2.7.1 (2008-06-23)
i386-pc-mingw32
Locale:
LC_COLLATE=English_United States.1252.......
Attached base packages:
[1] stats graphics grDevice utils datasets methods base
Any assistance would be much appreciated.
Best,
Ken Lo
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.