Why is mutate function not adding a new column to my table

dplyr functions do not perform in-place modifications, they return a new data frame as output, if you want changes to persist, you have to explicitly overwrite the original data frame with the assign operator. This is an example of the syntax with pseudo code.

original_dataframe <- original dataframe %>%
    mutate(new_column = column_1 - column_2)

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

4 Likes