Aggregate Function in dplyr Cheat Sheet

A Programming › R cheat sheet in English by shanly3011
9,429 views 3,851 downloads 13 Apr 2015 History
3.1 avg · 1 rating

Aggregate Functions in Summarise

mean(x) - Gives mean value
max(x) - Gives maximum value
median(x) - Gives median value
min(x) - Gives Minimum value
sd(x) - Gives Standard Deviation
var(x) - Gives Variance
IQR(x) - Inter Quartile range
diff(r­ange(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_dist­inct(x) - Returns the count of unique values in the vector

Badges

Good Cheat Sheet Nice Cheat Sheet Downloaded from Unusual Locations × 2

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.