[R] using "cut"

From: J. Scott Olsson <olsson_at_math.umd.edu>
Date: Sat, 26 May 2007 10:09:31 -0400

Suppose I have some data

>x <- rnorm(1000);
>y <- x*x;

then try to cut it into 2 chunks,

>c <- cut(y, breaks=2);


 Min. 1st Qu. Median Mean 3rd Qu. Max. 6.879e-06 9.911e-02 3.823e-01 9.499e-01 1.297e+00 8.342e+00


(-0.00833,4.17]     (4.17,8.35]
            958              42

Is that the correct behavior? Why is the left hand side of the interval negative?

How would I split a data vector into groups/intervals such that each interval contained the same number of points?

Thanks much!

        [[alternative HTML version deleted]]

R-help_at_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 Sat 26 May 2007 - 14:14:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 26 May 2007 - 17:31:01 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.