Key Concepts

Review core concepts you need to learn to master this subject

Summary Statistics in R

## AVERAGE mean(dat) #mean median(dat) #median ## RANGE min(dat) #minimum value max(dat) #maximum value range(dat) #minimum and maximum ## SPREAD sd(dat) #standard deviation var(dat) #variance ## FREQUENCY table(dat) #frequency of each value

Because R is mainly a statistical processing software, summary statistics come standard with base R functionality.

  • Use mean() and median() to calculate average of a vector.
  • Use min(), max(), and range() to see the range of a vector.
  • Use sd() or var() to calculate the spread of a vector.
  • Use table() to view the frequency of each value in a vector.