I wrote this piece of code a while ago and am now getting the below warning messages when I run it:
group_by(ID) %>%
summarise_each(funs(if (is.numeric(.))
mean(., na.rm = TRUE)
else
first(.)))
Warning messages: 1:
summarise_each_()was deprecated in dplyr 0.7.0. Please useacross()instead. This warning is displayed once every 8 hours. Calllifecycle::last_lifecycle_warnings()to see where this warning was generated. 2:funs()was deprecated in dplyr 0.8.0. Please use a list of either functions or lambdas:
Simple named list: list(mean = mean, median = median)
Auto named with
tibble::lst(): tibble::lst(mean, median)
Using lambdas list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
I have tried to update the code based using across() and list() but I cannot get it to work. Any ideas of how this code should be correctly updated?
Thanks