From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Converting data from tables to rows
From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data
Converting data from tables to rows
- [Instructor] Sometimes it's nice to be concise. It's nice to set up your data in compact formats. In R that often takes the form of tables that list categorical variables in combinations. And then you put, for instance, the number of cases or observations that fall into each combination. This is a very small, efficient way of storing your data and often presenting it, but it can also create some real problems for analysis. And so you may need to take your data out of a table format and put it into a long row by row format. And I want to show you how to do that. But I'm going to have to start with a little mea culpa by showing you how I used to demonstrate this, which I consider the wrong way. Now we're going to come down here and load a few packages, and then I'm going to show you a data set called UCB Admissions. That stands for University of California at Berkeley. And this is a very well known data set because it looks at the differences in associations that can happen at…
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.
Contents
-
-
-
-
-
-
-
(Locked)
Creating tidy data10m 12s
-
(Locked)
Using tibbles4m 51s
-
(Locked)
Using data.table4m 57s
-
(Locked)
Converting data from wide to tall and from tall to wide4m 13s
-
(Locked)
Converting data from tables to rows5m 2s
-
(Locked)
Working with dates and times6m 21s
-
Working with list data5m 14s
-
(Locked)
Working with XML data5m 22s
-
(Locked)
Working with categorical variables6m 29s
-
(Locked)
Filtering cases and subgroups7m 32s
-
(Locked)
-
-
-
-
-
-
-