Apologies is this is something a more seasoned R user would know, but I just came across this and wanted to ask about proper usage.
It appears to be possible to classify ranges for variables by using as.factor
. So, I could group observations into a range. For example, if I were looking at visits by user, it looks that I could write an if/then statement to bin the users by the range of visits they had, then get summary statistics based on the group.
Here is the link where I learned about this: http://programming-r-pro-bro.blogspot.com/2011/10/modelling-with-r-part-2.html
Now, while this function looks easier than grouping data by using plyr
and ddply
, it does not look to be powerful enough to break the variable into X number of bins (for example 10 for a decile) - You would have to do that yourself.
This leads to my question - Is one better than the other for grouping data, or are there just many ways to tackle grouping like this?
Thanks