课程: Data Visualization in R with ggplot2
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Boxplots
- [Instructor] Boxplots are a tool that help us visualize a dataset by providing a little more statistical insight. Let's go back to RStudio where I have our dataset loaded and imagine I want to look at how tuition varies for public versus private institutions. I might write some code to create a scatter plot. Let's start there. ggplot(data=college) and then I'm going to add on a point geometry where my mapping is from x to control and y=tuition. Now, before I run this, take a moment and try to imagine what the plot is going to look like. I have tuition, which is a continuous variable on the y-axis, so those values should be spread out vertically, but I have control, which is a discrete variable on the x-axis, and it only has two possible values. When I run this plot, I see a rather unhelpful visualization. I can't tell how many schools are at different points on this line because they're all blended together. Now, one way that I can improve this visualization is to change from a…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。