I\'m inside a big function I have to write. In the last part I have to calculate the mean of a column in a data frame. The name of the column I am operating on is given as a
Use summarise in the dplyr package:
summarise
dplyr
library(dplyr) summarise(df, Average = mean(col_name, na.rm = T))
note: dplyr supports both summarise and summarize.
summarize