There is an R function dedicated to finding the standard deviation of a dataset — we can cut out the step of first finding the variance. The R function
sd() takes a dataset as a parameter and returns the standard deviation of that dataset:
dataset <- c(4, 8, 15, 16, 23, 42) standard_deviation <- sd()
We’ve removed the code that calculated the variance of each dataset. By using
sd() we don’t need to take that middle step anymore.
nba_data as a parameter, and store the result in
Make a similar function call using
okcupid_data and store the result in