Top "Dplyr" questions

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

Summarize with conditions in dplyr

I'll illustrate my question with an example. Sample data: df <- data.frame(ID = c(1, 1, 2, 2, 3, 5), A = c("foo", "bar", "…

r dplyr sqldf
Why are my dplyr group_by & summarize not working properly? (name-collision with plyr)

I have a data frame that looks like this: #df ID DRUG FED AUC0t Tmax Cmax 1 1 0 100 5 20 2 1 1 200 6 25 3 0 1 NA 2 30 4 0 0 150 6 65 Ans so …

r plyr dplyr shadowing name-collision
How to create a lag variable within each group?

I have a data.table: set.seed(1) data <- data.table(time = c(1:3, 1:4), groups = c(rep(c("b", "a"), …

r data.table plyr dplyr
Extract row corresponding to minimum value of a variable by group

I wish to (1) group data by one variable (State), (2) within each group find the row of minimum value of another …

r dplyr data.table aggregate
R: How to filter/subset a sequence of dates

I have this data: (complete for December) date sessions 1 2014-12-01 1932 2 2014-12-02 1828 3 2014-12-03 2349 4 2014-12-04 8192 5 2014-12-05 3188 6 2014-12…

r filter subset dplyr
Filtering dates in dplyr

My tbl_df: > p2p_dt_SKILL_A%>% + select(Patch,Date,Prod_DL)%>% + head() Patch Date Prod_…

r date filter dplyr between
How to perform multiple left joins using dplyr in R

How do I join multiple dataframes in R using dplyr ? new <- left_join(x,y, by = "Flag") this …

r dplyr
dplyr: "Error in n(): function should not be called directly"

I am attempting to reproduce one of the examples in the dplyr package but am getting this error message. I …

r function plyr dplyr conflicting-libraries
dplyr summarise_each with na.rm

Is there a way to instruct dplyr to use summarise_each with na.rm=TRUE? I would like to take …

r dplyr
Convert column in data.frame to date

My dataframe a1 <- c("a","a","b","b","c","d","e","e") b2 <- c("01.01.2015", "02.02.2015", "14.02.2012", "16.08.2008", "17.06.2003", "31.01.2015", "07.01.2022", "09.05.2001") c3 <…

r date dplyr magrittr