课程: Data Visualization in R with ggplot2
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Adding institution size and control
- [Instructor] All right, if you look at the exercise files for this course, you'll find that I've created a start and complete file for each one of these videos in this challenge assignment. So, if you want to catch up and pick up where we've left off, you can get the file corresponding to the video that you left off at. Now, the code we have here builds the map that we finished within the previous video. I'd now like to add some additional dimensions to this data. I'd first like to include the type of institution using color information. I'd like public schools colored one way and private schools represented using a different color. I can do this by adding a color aesthetic to my point geometry and mapping it to the control variable in the college dataset. I just go here to my mapping in geom_point and add color=control. Now that I have control on the map, I next like to change the size of each point based upon the number of undergraduate students at each school. I can do this by…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。