Skip to content

Commit 2b5dee9

Browse files
committed
Merge branch 'master' of https://github.com/erikpal/blog
2 parents ae612f3 + 8753ac2 commit 2b5dee9

3 files changed

+2
-2
lines changed

content/post/2017-12-22-tidyr-example-use-gather-to-make-long-data.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tags:
1919

2020
I had the chance to make a very clean example of making long data from wide data. After a conversation about enrollment trends and demographics, I wanted to look more closely at the composition of students a four-year institutions in St. Louis. The data file available from [IPEDS](https://nces.ed.gov/ipeds/) provided a variable for each race/ethnicity class, further broken down by gender and total, for each year. The wide from with 160+ variables is simply to hard do much exploration with, but the tidy, long version, makes it much easier to work with (including some nice quick ggplots).
2121

22-
![](images/ipeds.png)
22+
![](ipeds.png)
2323

2424
After loading the CSV file, the first thing I do is rename the columns by finding/replacing with blank the portions that I don't need. They column names are just too long. Plus, I want to extract the year as its own variable, so it is easiest if I just remove everything after the year.
2525
```{r eval=FALSE}

content/post/2017-12-22-tidyr-example-use-gather-to-make-long-data.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<p>I had the chance to make a very clean example of making long data from wide data. After a conversation about enrollment trends and demographics, I wanted to look more closely at the composition of students a four-year institutions in St. Louis. The data file available from <a href="https://nces.ed.gov/ipeds/">IPEDS</a> provided a variable for each race/ethnicity class, further broken down by gender and total, for each year. The wide from with 160+ variables is simply to hard do much exploration with, but the tidy, long version, makes it much easier to work with (including some nice quick ggplots).</p>
2323
<div class="figure">
24-
<img src="images/ipeds.png" />
24+
<img src="ipeds.png" />
2525

2626
</div>
2727
<p>After loading the CSV file, the first thing I do is rename the columns by finding/replacing with blank the portions that I don’t need. They column names are just too long. Plus, I want to extract the year as its own variable, so it is easiest if I just remove everything after the year.</p>
File renamed without changes.

0 commit comments

Comments
 (0)