Top "Dplyr" questions

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

dply: order columns alphabetically in R

If I have a large DF (hundreds and hundreds) columns with different col_names randomly distributed alphabetically: df.x <…

r dataframe dplyr
use %>% with replacement functions like colnames()<-

How can I use the pipe operator to pipe into replacement function like colnames()<- ? Here's what I'm trying …

r dplyr magrittr
Set certain values to NA with dplyr

I'm trying to figure out a simple way to do something like this with dplyr (data set = dat, variable = x): …

r dplyr
Transposing in dplyr

I have the following data.frame df = structure(list(HEADER = c("HOME_TRPM", "AWAY_TRPM", "HOME_TEAM","AWAY_TEAM"), price = …

r dplyr transpose
Create new column with dplyr mutate and substring of existing column

I have a dataframe with a column of strings and want to extract substrings of those into a new column. …

r dplyr strsplit
dplyr: how to reference columns by column index rather than column name using mutate?

Using dplyr, you can do something like this: iris %>% head %>% mutate(sum=Sepal.Length + Sepal.Width) Sepal.Length …

r dplyr
Arranging rows in custom order using dplyr

With arrange function in dplyr, we can arrange row in ascending or descending order. Wonder how to arrange rows in …

r dplyr data-manipulation
dplyr: nonstandard column names (white space, punctuation, starts with numbers)

df <- structure(list(`a a` = 1:3, `a b` = 2:4), .Names = c("a a", "a b" ), row.names = c(NA, -3…

r dataframe dplyr
Filtering observations in dplyr in combination with grepl

I am trying to work out how to filter some observations from a large dataset using dplyr and grepl . I …

r filter dplyr grepl
dplyr - groupby on multiple columns using variable names

I am working with R Shiny for some exploratory data analysis. I have two checkbox inputs that contain only the …

r group-by shiny dplyr