Top "Mutate" questions

mutate is a verb to create a new column in a data frame using dplyr package in R programming language.

Can dplyr package be used for conditional mutating?

Can the mutate be used when the mutation is conditional (depending on the values of certain column values)? This example …

r if-statement dplyr case-when mutate
dplyr mutate with conditional values

In a large dataframe ("myfile") with four columns I have to add a fifth column with values conditionally based on …

r dplyr mutate
Calculate group mean (or other summary stats) and assign to original data

I want to calculate mean (or any other summary statistics of length one, e.g. min, max, length, sum) of …

r mean summary mutate r-faq
R: row-wise dplyr::mutate using function that takes a data frame row and returns an integer

I am trying to use pipe mutate statement using a custom function. I looked a this somewhat similar SO post …

r dplyr row mutate
mutate by group in R

I have a data with following columns: Date CID FID rank 31/01/17 abc0001 rx180x01 0 31/01/17 abc0001 rx180x02 0 31/01/17 abc0001 rx180x03 2 28/02/17 …

r dplyr window-functions mutate
How to use map from purrr with dplyr::mutate to create multiple new columns based on column pairs

I have to following issue using R. In short I want to create multiple new columns in a data frame …

r dplyr purrr mutate
How to use custom functions in mutate (dplyr)?

I'm rewriting all my code using dplyr, and need help with mutate / mutate_at function. All I need is to …

r dplyr mutate
Applying group_by and summarise(sum) but keep columns with non-relevant conflicting data?

My question is very similar to Applying group_by and summarise on data while keeping all the columns' info but …

r group-by tidyverse mutate summarize
Using dplyr to filter rows which contain partial string of column

Assuming I have a data frame like term cnt apple 10 apples 5 a apple on 3 blue pears 3 pears 1 How could I …

r filter dplyr mutate summarize
Recode multiple columns using dplyr

I had a dataframe where I recoded several columns so that 999 was set to NA dfB <-dfA %>% mutate(…

r dplyr recode mutate