From the course: Data Visualization in R with ggplot2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding institution size and control

Adding institution size and control

From the course: Data Visualization in R with ggplot2

Start my 1-month free trial

Adding institution size and control

- [Instructor] If you have access to the exercise files for this course, you'll find the code that I have loaded here in the start file of the directory for this video. This simply builds the map that we finished with in the previous video. I'd now like to add some additional dimensions to the 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 that aesthetic to the control variable in the college dataset. To do this, I just need to modify the geom_point call so that inside the aesthetic mapping, I add another aesthetic. I'm going to map the color aesthetic to the control variable and now when I run this visualization, schools are plotted differently according to their type of institutional control. Private schools have this salmon color and public schools have a light blue color. Now…

Contents