Top "Dplyr" questions

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

Error in ggplot.data.frame : Mapping should be created with aes or aes_string

I am having a trouble while extracting the path from a ggplot and am stuck with an error. The image …

r ggplot2 dplyr zoo
How to use dplyr to generate a frequency table

I like to create a table that has the frequency of several columns in my data frame. I am copying …

r dataframe dplyr frequency
Reorder rows using custom order

Given data: library(data.table) DT = data.table(category=LETTERS[1:3], b=1:3) DT # category b # 1: A 1 # 2: B 2 # 3: C 3 Using dplyr, how …

r dplyr
Using spread with duplicate identifiers for rows

I have a long form dataframe that have multiple entries for same date and person. jj <- data.frame(…

r dplyr tidyr
Create a ranking variable with dplyr?

Suppose I have the following data df = data.frame(name=c("A", "B", "C", "D"), score = c(10, 10, 9, 8)) I want to …

r dplyr
replace NA in a dplyr chain

Question has been edited from the original. After reading this interesting discussion I was wondering how to replace NAs in …

r dplyr
Concatenate strings by group with dplyr

i have a dataframe that looks like this > data <- data.frame(foo=c(1, 1, 2, 3, 3, 3), bar=c('a', 'b', …

r dplyr
ignore NA in dplyr row sum

is there an elegant way to handle NA as 0 (na.rm = TRUE) in dplyr? data <- data.frame(a=…

r sum dplyr
Can dplyr summarise over several variables without listing each one?

dplyr is amazingly fast, but I wonder if I'm missing something: is it possible summarise over several variables. For example: …

r dplyr
Replace NA with Zero in dplyr without using list()

In dplyr I can replace NA with 0 using the following code. The issue is this inserts a list into my …

r dplyr na