Top "Plyr" questions

plyr is an R package with tools to solve a variety of problems using the split-apply-combine strategy

Change value of variable with dplyr

I regularly need to change the values of a variable based on the values on a different variable, like this: …

r dataframe plyr 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
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
Aggregate a dataframe on a given column and display another column

I have a dataframe in R of the following form: > head(data) Group Score Info 1 1 1 a 2 1 2 b 3 1 3 c 4 2 4 d 5 2 3 …

r aggregate plyr greatest-n-per-group
Convert named list to vector with values only

I have a list of named values: myList <- list('A' = 1, 'B' = 2, 'C' = 3) I want a vector with the …

r list plyr
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
Reshape three column data frame to matrix ("long" to "wide" format)

I have a data.frame that looks like this. x a 1 x b 2 x c 3 y a 3 y b 3 y …

r matrix dataframe plyr reshape
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
Group by multiple columns and sum other multiple columns

I have a data frame with about 200 columns, out of them I want to group the table by first 10 or …

r grouping aggregate plyr data.table