Skip to content

Commit

Permalink
now full Build
Browse files Browse the repository at this point in the history
  • Loading branch information
riinuots committed Feb 6, 2020
1 parent bb3d919 commit 87d756d
Show file tree
Hide file tree
Showing 12 changed files with 448 additions and 2,842 deletions.
8 changes: 4 additions & 4 deletions 03_summarising.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
output:
pdf_document: default
html_document: default
pdf_document: default
---

```{r, include = FALSE}
```{r setup, include = FALSE}
options(pillar.sigfig = 4)
```

Expand Down Expand Up @@ -408,7 +408,7 @@ knitr::include_graphics("images/wide_long.png")

### Pivot values from rows into columns (wider)
\index{summarising data@\textbf{summarising data}!convert long to wide}
\index{functions@\textbf{functions}!pivot_wider}
\index{functions@\textbf{functions}!pivot\_wider}

If we want to take the long data from \@ref(tab:chap3-tab-gbd-long) and put some of the numbers next to each other for easier visualisation, then `pivot_wider()` from the `tidyr` package is the function to do it.
It means we want to send a variable into columns, and it needs just two arguments: the variable we want to become the new columns, and the variable where the values currently are.
Expand Down Expand Up @@ -450,7 +450,7 @@ Remember that pressing F1 when your cursor is on a function opens it up in the H

### Pivot values from columns to rows (longer)
\index{summarising data@\textbf{summarising data}!convert wide to long}
\index{functions@\textbf{functions}!pivot_longer}
\index{functions@\textbf{functions}!pivot\_longer}

The inverse of `pivot_wider()` is `pivot_longer()`.
If you're lucky enough, your data comes from a proper database and is already in the long and tidy format.
Expand Down
2 changes: 1 addition & 1 deletion data/global_burden_disease_wide-format.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cause,Female-1990,Female-2017,Male-1990,Male-2017
cause,Female_1990,Female_2017,Male_1990,Male_2017
Communicable diseases,7.3,4.91,8.06,5.47
Injuries,1.4100000000000001,1.42,2.84,3.05
Non-communicable diseases,12.8,19.15,13.91,21.74
Binary file modified docs/healthyr-book.pdf
Binary file not shown.
945 changes: 0 additions & 945 deletions healthyr-book.aux

This file was deleted.

302 changes: 0 additions & 302 deletions healthyr-book.idx

This file was deleted.

9 changes: 0 additions & 9 deletions healthyr-book.ilg

This file was deleted.

Loading

0 comments on commit 87d756d

Please sign in to comment.