Answers for "mutate example in r"

0

r mutate function

# Create the 'month' column
df %>%
  mutate(month = str_sub(birthday,1,2))
 
# Create the 'day' column
df %>%
  mutate(day = str_sub(birthday,3,4))
 
# Create the 'year' column
df %>%
  mutate(year = str_sub(birthday,5))
Posted by: Guest on February-27-2021

Browse Popular Code Answers by Language