mean()

mean()

 The mean() function computes the mean of a variable.

Example:

# Calculate the mean of Thumb
mean(Fingers$Thumb)

# Alt: use 'data =' argument instead of '$' (produces same output)
mean(~Thumb, data = Fingers)

Example output:

Output of mean() function for Thumb