DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Cut Allows Break Up For Continous Data
In order to break apart continuous data such as a series of body weights into categories us cut.
Usage:
#simple
cut(data, breaks = 4) # break the data up into four groups
#slightly more sophisticated
#Get range range(data) #define breaks breaks = seq(min, max, by=n) #n = the interval size #perform the cut and store in var wt.cut = cut(wt, breaks) #view in table table(wt.cut) #can easily graph barplot(table(wt.cut)





