From the course: R for Data Science: Analysis and Visualization
Unlock the full course today
Join today to access over 25,000 courses taught by industry experts.
Creating scatterplots - R Tutorial
From the course: R for Data Science: Analysis and Visualization
Creating scatterplots
- [Instructor] Scatter plots are one of the best ways of looking at associations between two quantitative or measured or scaled variables. To demonstrate this in R, let's load our libraries. And then from our data set, which is state trends, let's bring in just the five terms about searches for sports. I do that by reading in the CSV and then selecting basketball through hockey. That brings in five sports. And then we'll use a glimpse. It's a slightly different way of looking at the data from what we've used before. And when we do that, you can see here that we have read in. It tells us which variables are character, which ones are double, but then when we specify just the five variables from basketball through hockey, they're all double precision. And here are the initial values and that's great. That's what we're looking for. Now, to make a scatter plot, we have an option of simply plotting all of the associations.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.