@@ -106,7 +106,7 @@ near(1 / 49 * 49, 1)
|
||||
|
||||
Multiple arguments to `filter()` are combined with "and": every expression must be true in order for a row to be included in the output. For other types of combinations, you'll need to use Boolean operators yourself: `&` is "and", `|` is "or", and `!` is "not". Figure \@ref(fig:bool-ops) shows the complete set of Boolean operations.
|
||||
|
||||
```{r bool-ops, echo = FALSE, fig.cap = "Complete set of boolean operations. `x` is the left-hand circle, `y` is the right hand circle, and the shaded region show which parts each operator selects."}
|
||||
```{r bool-ops, echo = FALSE, fig.cap = "Complete set of boolean operations. `x` is the left-hand circle, `y` is the right-hand circle, and the shaded region show which parts each operator selects."}
|
||||
knitr::include_graphics("diagrams/transform-logical.png")
|
||||
```
|
||||
|
||||
@@ -192,7 +192,7 @@ filter(df, is.na(x) | x > 1)
|
||||
|
||||
1. Find all flights that
|
||||
|
||||
1. Had an arrival delay of two or more hours.
|
||||
1. Had an arrival delay of two or more hours
|
||||
1. Flew to Houston (`IAH` or `HOU`)
|
||||
1. Were operated by United, American, or Delta
|
||||
1. Departed in summer (July, August, and September)
|
||||
@@ -675,7 +675,7 @@ Just using means, counts, and sum can get you a long way, but R provides many ot
|
||||
* Measures of spread: `sd(x)`, `IQR(x)`, `mad(x)`. The mean squared deviation,
|
||||
or standard deviation or sd for short, is the standard measure of spread.
|
||||
The interquartile range `IQR()` and median absolute deviation `mad(x)`
|
||||
are robust equivalents that maybe more useful if you have outliers.
|
||||
are robust equivalents that may be more useful if you have outliers.
|
||||
|
||||
```{r}
|
||||
# Why is distance to some destinations more variable than to others?
|
||||
@@ -772,7 +772,7 @@ Just using means, counts, and sum can get you a long way, but R provides many ot
|
||||
|
||||
### Grouping by multiple variables
|
||||
|
||||
When you group by multiple variables, each summary peels off one level of the grouping. That makes it easy to progressively roll-up a dataset:
|
||||
When you group by multiple variables, each summary peels off one level of the grouping. That makes it easy to progressively roll up a dataset:
|
||||
|
||||
```{r}
|
||||
daily <- group_by(flights, year, month, day)
|
||||
|
||||
Reference in New Issue
Block a user