Mean of a column in a data frame, given the column’s name
I think you’re asking how to compute the mean of a variable in a data frame, given the name of the column. There are two typical approaches to doing this, one indexing with [[ and the other indexing with [: