Tutorial by Examples

split allows to divide a vector or a data.frame into buckets with regards to a factor/group variables. This ventilation into buckets takes the form of a list, that can then be used to apply group-wise computation (for loops or lapply/sapply). First example shows the usage of split on a vector: Con...
A popular form of data analysis is split-apply-combine, in which you split your data into groups, apply some sort of processing on each group, and then combine the results. Let's consider a data analysis where we want to obtain the two cars with the best miles per gallon (mpg) for each cylinder cou...

Page 1 of 1