I am going to create a spider chart using following code, but error message occurred, can anyone help me to solve the problem? Thank you!
when run
mtcars %>% rownames_to_column(var="group") %>%
mutate_each(funs(rescale), ~group) %>%
tail(4) %>% select(1:10) ->mtcars_radar
Error message displayed
`mutate_each()` is deprecated.
Use `mutate_all()`, `mutate_at()` or `mutate_if()` instead.
To map `funs` over a selection of variables, use `mutate_at()`
Error: `~group` must evaluate to column positions or names, not formula
#Here is the entire program
######################################################################
library(ggradar)
suppressPackageStartupMessages(library(dplyr))
library(scales)
library(tibble)
data(mtcars)
mtcars %>% as_data_frame() %>% rownames_to_column(var="group") %>%
mutate_each(funs(rescale), ~group) %>%
tail(4) %>% select(1:10) ->mtcars_radar
mtcars %>% rownames_to_column(var="group") %>%
mutate_each(funs(rescale), ~group) %>%
tail(4) %>% select(1:10) ->mtcars_radar
##ggradar make spider chart
ggradar(mtcars_radar)