I'm trying to get five intervals of 150 samples but apparently the R cut method is giving me a wrong result. Below I leave the dataset and the code
age = c(89,81,59,80,74,36,28,73,44,51,31,75,31,60,42,16,38,76,72,67,47,31,63,45,58,78,45,90,41,53,24,47,41,24,59,
18,72,12,79,80,73,47,74,37,30,24,61,50,82,84,63,60,39,23,72,67,46,37,14,90,50,12,20,25,55,87,59,76,23,23,
36,61,19,65,42,80,23,41,20,77,20,52,54,33,38,53,71,78,71,12,77,40,80,23,45,58,73,24,50,15,81,61,59,33,37,
51,59,25,17,65,83,35,78,48,25,38,88,14,40,72,80,89,70,42,88,14,51,35,21,88,73,53,81,85,30,66,57,34,90,53,
40,80,76,24,33,69,81,52,35,33)
table((cut(age, breaks=5, right=FALSE, dig.lab=2))
# ---- results (wrong) ----
[12,28) [28,43) [43,59) [59,74) [74,90)
28 32 26 31 33
the correct result is as shown in the following table
| [12 - 28> | [28 - 43> | [43 - 59> | [59 - 74> | [74 - 90] |
|---|---|---|---|---|
| 28 | 32 | 26 | 29 | 35 |