Describe how each operation changes when you combine it with grouping. Refer back to the lists of useful mutate and filtering functions. 5.7 Notes - Grouped mutates (and filters).What does the sort argument to count() do. Which carrier has the worst delays? Challenge: can you disentangle the effects of bad airports vs. bad carriers? Why/why not? (Hint: think about flights %>% group_by(carrier, dest) %>% summarise(n())) Is there a pattern? Is the proportion of cancelled flights related to the average delay? Look at the number of cancelled flights per day. Our definition of cancelled flights (is.na(dep_delay) | is.na(arr_delay) ) is slightly suboptimal. What happens if you map an aesthetic to something other than a variable name, like aes(colour = displ % count(dest) and not_cancelled %>% count(tailnum, wt = distance) (without using count()). What does the stroke aesthetic do? What shapes does it work with? (Hint: use ?geom_point) What happens if you map the same variable to multiple aesthetics? How do these aesthetics behave differently for categorical vs. continuous variables? Map a continuous variable to color, size, and shape. How can you see this information when you run mpg? Which variables in mpg are categorical? Which variables are continuous? (Hint: type ?mpg to read the documentation for the dataset). What’s gone wrong with this code? Why are the points not blue? What happens if you make a scatterplot of class vs drv? Why is the plot not useful? What does the drv variable describe? Read the help for ?mpg to find out. How many rows are in mpg? How many columns?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |