How to use head method In R Language
The do method is used to perform a specific task of returning a subset of values of the data frame by applying methods like head over it. The head(.,1) is used to print the first row of every group contained in the group_by method.
R
# Head method data %>% group_by (col3) %>% do ( head (., 1)) |
Output:
Row wise operation in R using Dplyr
The dplyr package in R programming is used to perform simulations in the data by performing manipulations and transformations. It can be installed into the working space using the following command :
install.packages("dplyr")