Tutorial by Examples

dplyr introduces a grammar of data manipulation in R. It provides a consistent interface to work with data no matter where it is stored: data.frame, data.table, or a database. The key pieces of dplyr are written using Rcpp, which makes it very fast for working with in-memory data. dplyr's philosoph...
dplyr::filter() - Select a subset of rows in a data frame that meet a logical criteria: dplyr::filter(iris,Sepal.Length>7) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species # 1 7.1 3.0 5.9 2.1 virginica # 2 7.6 3.0 ...
The pipe (%>%) operator could be used in combination with dplyr functions. In this example we use the mtcars dataset (see help("mtcars") for more information) to show how to sumarize a data frame, and to add variables to the data with the result of the application of a function. librar...
dplyr uses Non-Standard Evaluation(NSE), which is why we normally can use the variable names without quotes. However, sometimes during the data pipeline, we need to get our variable names from other sources such as a Shiny selection box. In case of functions like select, we can just use select_ to u...

Page 1 of 1