Skip to content

Commit 21093d0

Browse files
committed
Use pak::pak() in README
1 parent 90f217c commit 21093d0

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ install.packages("magrittr")
6565
6666
# Or the development version from GitHub:
6767
# install.packages("devtools")
68-
devtools::install_github("tidyverse/magrittr")
68+
pak::pak("tidyverse/magrittr")
6969
```
7070

7171
## Usage

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,27 @@
88
[![CRAN
99
status](https://www.r-pkg.org/badges/version/magrittr)](https://cran.r-project.org/package=magrittr)
1010
[![Codecov test
11-
coverage](https://codecov.io/gh/tidyverse/magrittr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/magrittr?branch=master)
12-
[![R build
13-
status](https://github.com/tidyverse/magrittr/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/magrittr/actions)
11+
coverage](https://codecov.io/gh/tidyverse/magrittr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/magrittr?branch=main)
12+
[![R-CMD-check](https://github.com/smbache/magrittr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/smbache/magrittr/actions/workflows/R-CMD-check.yaml)
1413
<!-- badges: end -->
1514

1615
## Overview
1716

1817
The magrittr package offers a set of operators which make your code more
1918
readable by:
2019

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

2827
The operators pipe their left-hand side values forward into expressions
29-
that appear on the right-hand side, i.e. one can replace `f(x)` with `x
30-
%>% f()`, where `%>%` is the (main) pipe-operator. When coupling several
31-
function calls with the pipe-operator, the benefit will become more
32-
apparent. Consider this pseudo example:
28+
that appear on the right-hand side, i.e. one can replace `f(x)` with
29+
`x %>% f()`, where `%>%` is the (main) pipe-operator. When coupling
30+
several function calls with the pipe-operator, the benefit will become
31+
more apparent. Consider this pseudo example:
3332

3433
``` r
3534
the_data <-
@@ -59,16 +58,16 @@ install.packages("magrittr")
5958

6059
# Or the development version from GitHub:
6160
# install.packages("devtools")
62-
devtools::install_github("tidyverse/magrittr")
61+
pak::pak("tidyverse/magrittr")
6362
```
6463

6564
## Usage
6665

6766
### Basic piping
6867

69-
- `x %>% f` is equivalent to `f(x)`
70-
- `x %>% f(y)` is equivalent to `f(x, y)`
71-
- `x %>% f %>% g %>% h` is equivalent to `h(g(f(x)))`
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)))`
7271

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

7877
### The argument placeholder
7978

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

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

@@ -87,14 +86,14 @@ right-hand side expression. However, when the placeholder only appears
8786
in a nested expressions magrittr will still apply the first-argument
8887
rule. The reason is that in most cases this results more clean code.
8988

90-
`x %>% f(y = nrow(.), z = ncol(.))` is equivalent to `f(x, y = nrow(x),
91-
z = ncol(x))`
89+
`x %>% f(y = nrow(.), z = ncol(.))` is equivalent to
90+
`f(x, y = nrow(x), z = ncol(x))`
9291

9392
The behavior can be overruled by enclosing the right-hand side in
9493
braces:
9594

96-
`x %>% {f(y = nrow(.), z = ncol(.))}` is equivalent to `f(y = nrow(x), z
97-
= ncol(x))`
95+
`x %>% {f(y = nrow(.), z = ncol(.))}` is equivalent to
96+
`f(y = nrow(x), z = ncol(x))`
9897

9998
### Building (unary) functions
10099

0 commit comments

Comments
 (0)