Answers for "mutate function in r"

C
3

r how to mutate

mutate(.data, ...)

# S3 method for data.frame
mutate(
  .data,
  ...,
  .keep = c("all", "used", "unused", "none"),
  .before = NULL,
  .after = NULL
)
Posted by: Guest on June-08-2020
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
0

use function within mutate r

iris %>% 
  rowwise() %>% 
  mutate(Max.Len= max(Sepal.Length,Petal.Length))
Posted by: Guest on June-21-2021
0

r code mutate

starwars %>%
  select(name, mass, species) %>%
  mutate(mass_norm = mass / mean(mass, na.rm = TRUE))
Posted by: Guest on November-15-2020
0

r mutate function

#remove %
students <- students %>% 
  mutate(score=gsub('\%','',score))
Posted by: Guest on February-27-2021

Code answers related to "C"

Browse Popular Code Answers by Language