Hi,
Use mutate(). returns selected columns after modifying the existing values with new calculated values in the column. if you want to return only updated column values use transmute().
mutate() adds new variables and preserves existing ones. transmute() adds new variables and drops existing ones. Both functions preserve the number of rows of the input. New variables overwrite existing variables of the same name.
Ex:
mtcars %>% mutate(cyl = cyl/2)
mtcars %>% transmute(cyl= cyl/2)