Basic Data Analysis
Get started analyzing data in R!
StartKey Concepts
Review core concepts you need to learn to master this subject
Summary Statistics in R
ggplot() Initializes a ggplot Object
ggplot2 Aesthetics
Creating Regression Models in R
Making Predictions from Regression Objects in R
Summary Statistics in R
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()
andmedian()
to calculate average of a vector. - Use
min()
,max()
, andrange()
to see the range of a vector. - Use
sd()
orvar()
to calculate the spread of a vector. - Use
table()
to view the frequency of each value in a vector.