Skip to content
Prev 332759 / 398506 Next

R 3.0.2 - How to create intervals and group another variable in those intervals?

You need to read up on the use of the "apply" functions: this is just
another 'tapply' call with the 'speed' in it.
+  , spacing = rnorm(n)
+  )
(0,4.5]      (4.5,9]     (9,13.5]    (13.5,18]    (18,22.5]
(22.5,27]    (27,31.5]    (31.5,36]
-0.260755737 -0.017766405 -0.097255963  0.234719308 -0.038908267
-0.004559798 -0.065556109 -0.144327936
   (36,40.5]    (40.5,45]    (45,49.5]    (49.5,54]    (54,58.5]
(58.5,63]    (63,67.5]    (67.5,72]
-0.135491878 -0.120387573  0.033821289 -0.110058896 -0.107173009
-0.091258106 -0.198911676 -0.138334909
   (72,76.5]    (76.5,81]    (81,85.5]
-0.127941501  0.198943106  0.136345405
(0,4.5]   (4.5,9]  (9,13.5] (13.5,18] (18,22.5] (22.5,27] (27,31.5]
(31.5,36] (36,40.5] (40.5,45]
 2.276792  6.804097 11.024388 15.699358 20.184667 24.644743 29.050843
34.017265 38.288514 42.617572
(45,49.5] (49.5,54] (54,58.5] (58.5,63] (63,67.5] (67.5,72] (72,76.5]
(76.5,81] (81,85.5]
47.357247 51.808874 56.162820 60.719576 65.202813 70.055034 74.147431
79.070495 83.376027
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.
On Wed, Nov 6, 2013 at 12:36 PM, umair durrani <umairdurrani at outlook.com> wrote: