Skip to content

Commit

Permalink
reorder clipr demo statements in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlincoln committed Feb 24, 2022
1 parent 7de5b39 commit d14fc11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
11 changes: 5 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ remotes::install_github("mdlincoln/clipr")

## Usage

``` {r}
library("clipr")
cb <- read_clip()
```

clipr is pipe-friendly, and will default to returning the same object that was passed in.

```{r pipe-friendly}
library("clipr")
res <- write_clip(c("Text", "for", "clipboard"))
res
cb <- read_clip()
cb
```

To capture the string that clipr writes to the clipboard, specify `return_new = TRUE`. Character vectors with length > 1 will be collapsed with system-appropriate line breaks, unless otherwise specified
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ remotes::install_github("mdlincoln/clipr")

## Usage

``` r
library("clipr")
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.

cb <- read_clip()
```

clipr is pipe-friendly, and will default to returning the same object
that was passed in.

``` r
library("clipr")
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.

res <- write_clip(c("Text", "for", "clipboard"))
res
#> [1] "Text" "for" "clipboard"

cb <- read_clip()
cb
#> [1] "Text" "for" "clipboard"
```

To capture the string that clipr writes to the clipboard, specify
Expand Down

0 comments on commit d14fc11

Please sign in to comment.