From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Cumulative sums and more: cumsum, cumall, and cumany - R Tutorial
From the course: Learning the R Tidyverse
Cumulative sums and more: cumsum, cumall, and cumany
- [Instructor] dplyr is a member of the tidyverse and provides a number of different verbs for manipulating, dissecting, and otherwise wrangling data. dplyr includes a number of functions or verbs for calculating a variety of different cumulative measures and similar operations. There are two types of cumulative operations in dplyr. The first type of operation is the simplest, simply calculating cumulative values. For instance, the running total. This is really simple and I'll show how it works with group data frames, shortly. The other type of operation is slightly more complicated and it's extracting rows before or after a certain value. You may have data, for instance, for viewing figures for websites and you may have, over the time period of data, a marketing viral event. And you're interested in looking at the number of views up to that viral event or after that viral event. dplyr provides useful tools for splitting your data by a viral event and let's look at how to do that in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.