September 2018
Beginner
206 pages
4h 27m
English
The following code can be used to load the mtcars dataset and examine it:
data("mtcars")str(mtcars)
Use the following code to summarize all the variables in the mtcars dataset that are not categorical, and find the mean and variance of each:
apply(mtcars[,-c(2,10,11)], 2, function(x) c(mean(x), var(x)))diamonds %>% group_by(color, clarity) %>% summarise(median(price))diamonds %>% filter(color != "D" & color != "H") %>% group_by(color) %>% summarise(median(depth))
Read now
Unlock full access