Skip to content

Commit 8d14c20

Browse files
committed
correct pak installation instruction
1 parent 21093d0 commit 8d14c20

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

README.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ install.packages("tidyverse")
6464
install.packages("magrittr")
6565
6666
# Or the development version from GitHub:
67-
# install.packages("devtools")
67+
# install.packages("pak")
6868
pak::pak("tidyverse/magrittr")
6969
```
7070

README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ coverage](https://codecov.io/gh/tidyverse/magrittr/branch/main/graph/badge.svg)]
1717
The magrittr package offers a set of operators which make your code more
1818
readable by:
1919

20-
- structuring sequences of data operations left-to-right (as opposed
21-
to from the inside and out),
22-
- avoiding nested function calls,
23-
- minimizing the need for local variables and function definitions,
24-
and
25-
- making it easy to add steps anywhere in the sequence of operations.
20+
- structuring sequences of data operations left-to-right (as opposed to
21+
from the inside and out),
22+
- avoiding nested function calls,
23+
- minimizing the need for local variables and function definitions, and
24+
- making it easy to add steps anywhere in the sequence of operations.
2625

2726
The operators pipe their left-hand side values forward into expressions
2827
that appear on the right-hand side, i.e. one can replace `f(x)` with
@@ -57,17 +56,17 @@ install.packages("tidyverse")
5756
install.packages("magrittr")
5857

5958
# Or the development version from GitHub:
60-
# install.packages("devtools")
59+
# install.packages("pak")
6160
pak::pak("tidyverse/magrittr")
6261
```
6362

6463
## Usage
6564

6665
### Basic piping
6766

68-
- `x %>% f` is equivalent to `f(x)`
69-
- `x %>% f(y)` is equivalent to `f(x, y)`
70-
- `x %>% f %>% g %>% h` is equivalent to `h(g(f(x)))`
67+
- `x %>% f` is equivalent to `f(x)`
68+
- `x %>% f(y)` is equivalent to `f(x, y)`
69+
- `x %>% f %>% g %>% h` is equivalent to `h(g(f(x)))`
7170

7271
Here, “equivalent” is not technically exact: evaluation is non-standard,
7372
and the left-hand side is evaluated before passed on to the right-hand
@@ -76,8 +75,8 @@ implication.
7675

7776
### The argument placeholder
7877

79-
- `x %>% f(y, .)` is equivalent to `f(y, x)`
80-
- `x %>% f(y, z = .)` is equivalent to `f(y, z = x)`
78+
- `x %>% f(y, .)` is equivalent to `f(y, x)`
79+
- `x %>% f(y, z = .)` is equivalent to `f(y, z = x)`
8180

8281
### Re-using the placeholder for attributes
8382

@@ -120,6 +119,9 @@ iris %>%
120119
subset(Sepal.Length > mean(Sepal.Length)) %$%
121120
cor(Sepal.Length, Sepal.Width)
122121
#> [1] 0.3361992
122+
```
123+
124+
``` r
123125

124126
data.frame(z = rnorm(100)) %$%
125127
ts.plot(z)

0 commit comments

Comments
 (0)