Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
nxskok committed Sep 19, 2023
1 parent 1d71a01 commit 6bc93fa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 39 deletions.
8 changes: 3 additions & 5 deletions _freeze/choosing/execute-results/html.json

Large diffs are not rendered by default.

Binary file modified c32_plan.gnumeric
Binary file not shown.
28 changes: 13 additions & 15 deletions choosing.html

Large diffs are not rendered by default.

20 changes: 2 additions & 18 deletions choosing.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ athletes %>% select(Sport)
athletes %>% select(Sport, Hg, BMI)
```

## Choosing consecutive columns
## Choosing consecAutive columns

```{r choosing-R-4}
athletes %>% select(Sex:WCC)
Expand All @@ -58,7 +58,7 @@ Other ways to select columns: those whose name:
- `matches` a "regular expression"
- `everything()` select all the columns

## Columns whose names begin with S
## Columns whose names Abegin with S

```{r choosing-R-6}
athletes %>% select(starts_with("S"))
Expand Down Expand Up @@ -109,45 +109,29 @@ athletes %>% select(where(is.character))

## Choosing rows by number

\tiny

```{r choosing-R-12}
athletes %>% slice(16:25)
```

\normalsize

## Non-consecutive rows

\tiny

```{r choosing-R-13}
athletes %>%
slice(10, 13, 17, 42)
```

\normalsize

## A random sample of rows

\tiny

```{r choosing-R-14}
athletes %>% slice_sample(n=8)
```

\normalsize

## Rows for which something is true

\tiny

```{r choosing-R-15}
athletes %>% filter(Sport == "Tennis")
```

\normalsize

## More complicated selections

```{r choosing-R-16}
Expand Down
4 changes: 3 additions & 1 deletion numsum.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ athletes %>% summarize(m = mean(BMI), s = sd(BMI)) -> d
d
```

This doesn't work:

```{r}
#| error: true
mean(BMI)
```


## Quartiles

- `quantile` calculates percentiles ("fractiles"), so we want the 25th
Expand Down

0 comments on commit 6bc93fa

Please sign in to comment.