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.
Computing frequencies - R Tutorial
From the course: R for Data Science: Analysis and Visualization
Computing frequencies
- [Instructor] The simplest analysis you can do is simply counting how often things happen in your dataset, and strangely, that can be really informative, and is the basis for a lot of very sophisticated approaches, but let's start with just getting the simple frequencies. How common is each score or category in your dataset? We'll do this by opening the script 05_01_frequencies.r. And then the first step is to load the tidy first, 'cause we're going to rely on some of its functions. And then we're going to load our dataset. We're going to read the CSV of state trends. We're going to select a few variables. We're going to mutate or change several of them to be factors. That's going to be important in a minute, using the as.factor command. And then we will print it and also save it to the environment. So we've saved it to the environment. And we also see the three variables that we've got right here. And so we can start looking at the frequencies. How often do each one of these things…
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.