-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path_notes_to_myself.Rmd
More file actions
65 lines (34 loc) · 1.51 KB
/
Copy path_notes_to_myself.Rmd
File metadata and controls
65 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: "_notes_to_myself"
author: "Martin Monkman"
date: "02/01/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## publishing
a two-step process:
1. render
```{r}
bookdown::render_book()
```
2. publish to bookdown.org
```{r}
bookdown::publish_book(name = "DataAnalyticsCodingFundamentals", account = "martin_monkman")
```
## data cleaning resources
https://twitter.com/CDelawalla/status/1516026363484033027
Simultaneous use of multiple imputation for missing data and disclosure limitation
https://www150.statcan.gc.ca/n1/en/catalogue/12-001-X20040027755
## Tangent: Arguments within functions
Virtually every function we use has default arguments, and options to change those. This allows us to use one function for a variety of circumstances. Instead of having separate functions to split a variable into its quartiles (four parts), quintiles (five parts), deciles (ten parts), and so on, there is one function that uses the generic name for this process: quantile.
The default setting of the `quantile()` function splits the distribution into four parts, known as _quartiles_. This is the most common quantile used to summarize a distribution.
```{r}
quantile(gapminder$lifeExp)
```
If you want other groupings, the function has arguments that allow you define those. For example, if you want deciles—10 groups, each with 10% of the cases—the second example shows how to do that.
```{r}
# deciles
quantile(gapminder$lifeExp, probs = seq(0, 1, 0.10))
```