Top "Dplyr" questions

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

How to specify "does not contain" in dplyr filter

I am quite new to R. Using the table called SE_CSVLinelist_clean, I want to extract the rows where …

r filter dplyr
Removing NA observations with dplyr::filter()

My data looks like this: library(tidyverse) df <- tribble( ~a, ~b, ~c, 1, 2, 3, 1, NA, 3, NA, 2, 3 ) I can remove all …

r dplyr tidyr tidyverse
Get dplyr count of distinct in a readable way

I'm new using dplyr, I need to calculate the distinct values in a group. Here's a table example: data=data.…

r dplyr idioms summarization
Getting the top values by group

Here's a sample data frame: d <- data.frame( x = runif(90), grp = gl(3, 30) ) I want the subset of d …

r data.table dplyr
dplyr issues when using group_by(multiple variables)

I want to start using dplyr in place of ddply but I can't get a handle on how it works (…

r group-by dplyr compound-key
Extract a dplyr tbl column as a vector

Is there a more succinct way to get one column of a dplyr tbl as a vector, from a tbl …

r dplyr lazy-evaluation collect
Fixing a multiple warning "unknown column"

I have a persistent multiple warning of "unknown column" for all types of commands (e.g., str(x) to installing …

r dplyr
Applying a function to every row of a table using dplyr?

When working with plyr I often found it useful to use adply for scalar functions that I have to apply …

r plyr dplyr
R spreading multiple columns with tidyr

Take this sample variable df <- data.frame(month=rep(1:3,2), student=rep(c("Amy", "Bob"), each=3), A=c(9, 7, 6, 8, 6, 9), B=…

r dataframe dplyr tidyr
case_when in mutate pipe

It seems dplyr::case_when doesn't behave as other commands in a dplyr::mutate call. For instance: library(dplyr) case_…

r dplyr