НачатьНачать бесплатно

Mutate across multiple columns

You can use the across() function inside of mutate() to specify which columns you'd like to work with, which function to apply to these columns, and any text that you'd like to add on to the names of the new columns. Work with imf_data to create newly engineered columns from existing columns.

Это упражнение является частью курса

Programming with dplyr

Посмотреть курс

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Multiply as_perc_gdp columns by gdp_in_billions_of_usd
imf_new_cols <- imf_data %>% 
  mutate(___(.cols = ___, 
                .fns = ~ .x * ___),
         ___) 
Редактировать и запускать код