We can use the summarise() function from R in the dplyr package which will provide the mean and variance values as per below. If can include the below parameter to get the number of observations information as well. Expect to come across this, one of the most important R programming interview questions for experienced professionals in programming, in your next R interviews.