Top "Dplyr" questions

Use this tag for questions relating to functions from the dplyr package, such as group_by, summarize, filter, and select.

Relative frequencies / proportions with dplyr

Suppose I want to calculate the proportion of different values within each group. For example, using the mtcars data, how …

r group-by dplyr frequency
Replacement for "rename" in dplyr

I like plyr's renaming function rename. I have recently started using dplyr, and was wondering if there is an easy …

r rename dplyr
Can dplyr join on multiple columns or composite key?

I realize that dplyr v3.0 allows you to join on different variables: left_join(x, y, by = c("a" = "b") …

r dplyr
Sum across multiple columns with dplyr

My question involves summing up values across multiple columns of a data frame and creating a new column corresponding to …

r dplyr
How to select the rows with maximum values in each group with dplyr?

I would like to select a row with maximum value in each group with dplyr. Firstly I generate some random …

r dplyr plyr greatest-n-per-group
data.table vs dplyr: can one do something well the other can't or does poorly?

Overview I'm relatively familiar with data.table, not so much with dplyr. I've read through some dplyr vignettes and examples …

r data.table dplyr
Count number of rows by group using dplyr

I am using the mtcars dataset. I want to find the number of records for a particular combination of data. …

r dplyr count plyr
Use dynamic variable names in `dplyr`

I want to use dplyr::mutate() to create multiple new columns in a data frame. The column names and their …

r dplyr r-faq
R dplyr: Drop multiple columns

I have a dataframe and list of columns in that dataframe that I'd like to drop. Let's use the iris …

r dplyr
How to specify names of columns for x and y when joining in dplyr?

I have two data frames that I want to join using dplyr. One is a data frame containing first names. …

r join left-join dplyr