Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dummy <- data.frame(important_variable=seq(1:1000))
- require(Hmisc)
- dummy$cuts <- cut2(dummy$important_variable, g = 4)
- important_variable cuts
- 1 1 [ 1, 251)
- 2 2 [ 1, 251)
- 3 3 [ 1, 251)
- 4 4 [ 1, 251)
- 5 5 [ 1, 251)
- 6 6 [ 1, 251)
- > table(dummy$cuts)
- [ 1, 251) [251, 501) [501, 751) [751,1000]
- 250 250 250 250
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement