Re: [R] Partition into quantiles

From: David Barron <mothsailor_at_googlemail.com>
Date: Thu 05 Oct 2006 - 13:19:09 GMT

You might also want to look at the function quantcut in the gtools package (part of the gregmisc bundle).

On 05/10/06, Alberto Monteiro <albmont@centroin.com.br> wrote:
> Is there any function that divides a sample into N quantiles?
>
> For example, for N = 2, this would be the solution:
>
> x <- rnorm(100)
> m <- median(x)
> q <- ifelse(x <= median, 1, 2)
>
> Alberto Monteiro
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Thu Oct 05 23:22:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 05 Oct 2006 - 15:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.