From the course: R for Data Science: Analysis and Visualization

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Selecting cases and subgroups

Selecting cases and subgroups

- [Instructor] Sometimes you don't need to see everything all at once and having a little bit of focus can give you better, more useful insights in your data. One way to do this in R is through selecting cases. Actually, we're going to be using something called filtering to do the selection, but the idea is you can select individual cases or subgroups and give them your special attention. Let's start by loading our two packages and then we're going to load our data set and I'm going to convert a few of the variables to factors in that process. And so we've got our data set right here. I've kept state, the region, the geographical region, the psych_region, and their scores on one Google Trend search, and that is data_analysis. So this is the relative popularity of data_analysis as a search term for that state compared to other states. So let's start by filtering out some of these cases. We'll first look for the state where…

Contents