Possible Duplicate:
Create categorical variable in R based on range
Given a range and number of intervals that are desired how do i create equal intervals in R. eg. If the range is between 1 and 100 and i want to create 10 intervals, I should get 1 – 10, 11 – 20, …, 91 – 100. Only this function should work for any range and any number of intervals. If i have a range of 0 to 1 and number of intervals 30, then it should create the ranges such as 0 – 0.03, …, 0.97 – 1, and so on. The aim is to use these ranges to obtain values from a data.frame.
If you have
you can use
to get the cutpoints for your intervals.