How to calculate mean in R studio