Show Menu
Cheatography

Aggregate Function in dplyr Cheat Sheet by

Aggregate Functions in Summarise

mean(x) - Gives mean value
max(x) - Gives maximum value
media­n(x) - Gives median value
min(x) - Gives Minimum value
sd(x) - Gives Standard Deviation
var(x) - Gives Variance
IQR(x) - Inter Quartile range
diff(­ran­ge(x) - Gives the range
 

Aggregate Functions in dplyr

dplyr provides several helpful aggregate functions of its own.

first(x) - Returns First element
last(x) - Returns Last element
nth(x,n) - Returns nth element
n() - Returns number of rows
n_dis­tin­ct(x) - Returns the count of unique values in the vector
   

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          ggplot2-scatterplots Cheat Sheet
          iGraph Cheat Sheet

          More Cheat Sheets by shanly3011