├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── R ├── insertArgAddin.R ├── insertBizzaroPipeAddin.R ├── insertColonEqual.R ├── insertDotArrowPipeAddin.R ├── insertMagrittrCompoundPipeAddin.R ├── insertMagrittrPipeAddin.R ├── insertToDotPipeAddin.R ├── insertUsrAddin.R ├── insertZeallotArrow.R ├── package.R └── zzz.R ├── README.Rmd ├── README.md ├── addinexamplesWV.Rproj ├── docs ├── LICENSE.html ├── _config.yml ├── authors.html ├── index.html ├── jquery.sticky-kit.min.js ├── link.svg ├── pkgdown.css ├── pkgdown.js └── reference │ ├── addinexamplesWV.html │ ├── index.html │ ├── insertArgAddin.html │ ├── insertBizzaroPipeAddin.html │ ├── insertColonEqual.html │ ├── insertDotArrowPipeAddin.html │ ├── insertMagrittrCompoundPipeAddin.html │ ├── insertMagrittrPipeAddin.html │ ├── insertToDotPipeAddin.html │ ├── insertUsr1Addin.html │ ├── insertUsr2Addin.html │ ├── insertUsr3Addin.html │ └── insertZeallotArrow.html ├── inst └── rstudio │ └── addins.dcf └── man ├── addinexamplesWV.Rd ├── insertArgAddin.Rd ├── insertBizzaroPipeAddin.Rd ├── insertColonEqual.Rd ├── insertDotArrowPipeAddin.Rd ├── insertMagrittrCompoundPipeAddin.Rd ├── insertMagrittrPipeAddin.Rd ├── insertToDotPipeAddin.Rd ├── insertUsr1Addin.Rd ├── insertUsr2Addin.Rd ├── insertUsr3Addin.Rd └── insertZeallotArrow.Rd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^README.Rmd$ 4 | ^docs$ 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .DS_Store 5 | *~ 6 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: addinexamplesWV 2 | Title: Wrapr Dot Pipe Add-in 3 | Version: 0.2.0 4 | Authors@R: c(person("Kevin", "Ushey", email = "kevin@rstudio.com", role = c("aut")), 5 | person("John", "Mount", email = "jmount@win-vector.com", role = c("aut", "cre"))) 6 | Description: Provides an example set of RStudio addins -- R functions that can be 7 | bound to keyboard shortcuts, and called through different UI gestures. 8 | This repository is a fork of the original: https://github.com/rstudio/addinexamples . 9 | Depends: 10 | R (>= 3.0.0) 11 | Imports: 12 | shiny (>= 0.13), 13 | miniUI (>= 0.1.1), 14 | rstudioapi (>= 0.4), 15 | formatR 16 | License: MIT + file LICENSE 17 | LazyData: true 18 | RoxygenNote: 6.0.1 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2016 2 | COPYRIGHT HOLDER: RStudio, Inc. 3 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(insertArgAddin) 4 | export(insertBizzaroPipeAddin) 5 | export(insertColonEqual) 6 | export(insertDotArrowPipeAddin) 7 | export(insertMagrittrCompoundPipeAddin) 8 | export(insertMagrittrPipeAddin) 9 | export(insertToDotPipeAddin) 10 | export(insertUsr1Addin) 11 | export(insertUsr2Addin) 12 | export(insertUsr3Addin) 13 | export(insertZeallotArrow) 14 | import(formatR) 15 | import(miniUI) 16 | import(rstudioapi) 17 | import(shiny) 18 | -------------------------------------------------------------------------------- /R/insertArgAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert (.) . 2 | #' 3 | #' Call this function as an addin to insert \code{(.)} at the cursor position. 4 | #' 5 | #' @export 6 | insertArgAddin <- function() { 7 | rstudioapi::insertText("(.)") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertBizzaroPipeAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert ->.; . 2 | #' 3 | #' Call this function as an addin to insert \code{->.;} (Bizarro Pipe, \url{http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/}) at the cursor position. 4 | #' 5 | #' @export 6 | insertBizzaroPipeAddin <- function() { 7 | rstudioapi::insertText(" ->.; ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertColonEqual.R: -------------------------------------------------------------------------------- 1 | #' Insert := . 2 | #' 3 | #' Call this function as an addin to insert \code{:=} (Named map builder, \url{https://winvector.github.io/wrapr/reference/named_map_builder.html}) at the cursor position. 4 | #' 5 | #' @export 6 | insertColonEqual <- function() { 7 | rstudioapi::insertText(" := ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertDotArrowPipeAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert \%.>\% . 2 | #' 3 | #' Call this function as an addin to insert \code{\link[wrapr]{\%.>\%}} (dot pipe, \url{https://winvector.github.io/wrapr/articles/dot_pipe.html}) at the cursor position. 4 | #' 5 | #' @export 6 | insertDotArrowPipeAddin <- function() { 7 | rstudioapi::insertText(" %.>% ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertMagrittrCompoundPipeAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert \%<>\% . 2 | #' 3 | #' Call this function as an addin to insert \code{\link[magrittr]{\%<>\%}} (Magrittr pipe, \url{https://github.com/tidyverse/magrittr}) at the cursor position. 4 | #' 5 | #' @export 6 | insertMagrittrCompoundPipeAddin <- function() { 7 | rstudioapi::insertText(" %<>% ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertMagrittrPipeAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert \%>\% . 2 | #' 3 | #' Call this function as an addin to insert \code{\link[magrittr]{\%>\%}} (Magrittr pipe, \url{https://CRAN.R-project.org/package=magrittr}) at the cursor position. 4 | #' 5 | #' @export 6 | insertMagrittrPipeAddin <- function() { 7 | rstudioapi::insertText(" %>% ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertToDotPipeAddin.R: -------------------------------------------------------------------------------- 1 | #' Insert \%>.\% . 2 | #' 3 | #' Call this function as an addin to insert \code{\link[wrapr]{\%>.\%}} (dot pipe, \url{https://winvector.github.io/wrapr/reference/grapes-greater-than-.-grapes.html}) at the cursor position. 4 | #' 5 | #' @export 6 | insertToDotPipeAddin <- function() { 7 | rstudioapi::insertText(" %>.% ") 8 | } 9 | -------------------------------------------------------------------------------- /R/insertUsrAddin.R: -------------------------------------------------------------------------------- 1 | 2 | #' Insert user chosen text or operation. 3 | #' 4 | #' Call this function as an addin to insert user chosen text or operation at the cursor position. 5 | #' To set the option do something like the example. 6 | #' 7 | #' @examples 8 | #' 9 | #' # options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") }) 10 | #' 11 | #' @export 12 | insertUsr1Addin <- function() { 13 | fn <- options("addinexamplesWV.usrFn1") 14 | if(length(fn)>0) { 15 | # unpack from list 16 | fn[[1]]() 17 | } 18 | } 19 | 20 | #' Insert user chosen text or operation. 21 | #' 22 | #' Call this function as an addin to insert user chosen text or operation at the cursor position. 23 | #' To set the option do something like the example. 24 | #' 25 | #' @examples 26 | #' 27 | #' # options("addinexamplesWV.usrFn2" = function() { rstudioapi::insertText(" := ") }) 28 | #' 29 | #' @export 30 | insertUsr2Addin <- function() { 31 | fn <- options("addinexamplesWV.usrFn2") 32 | if(length(fn)>0) { 33 | # unpack from list 34 | fn[[1]]() 35 | } 36 | } 37 | 38 | #' Insert user chosen text or operation. 39 | #' 40 | #' Call this function as an addin to insert user chosen text or operation at the cursor position. 41 | #' To set the option do something like the example. 42 | #' 43 | #' @examples 44 | #' 45 | #' # options("addinexamplesWV.usrFn3" = function() { rstudioapi::insertText(" := ") }) 46 | #' 47 | #' @export 48 | insertUsr3Addin <- function() { 49 | fn <- options("addinexamplesWV.usrFn3") 50 | if(length(fn)>0) { 51 | # unpack from list 52 | fn[[1]]() 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /R/insertZeallotArrow.R: -------------------------------------------------------------------------------- 1 | #' Insert \%<-\% . 2 | #' 3 | #' Call this function as an addin to insert \code{\%<-\%} (Zeallot Arrow, \url{https://CRAN.R-project.org/package=zeallot}) at the cursor position. 4 | #' 5 | #' @export 6 | insertZeallotArrow <- function() { 7 | rstudioapi::insertText(" %<-% ") 8 | } 9 | -------------------------------------------------------------------------------- /R/package.R: -------------------------------------------------------------------------------- 1 | #' addinexamplesWV 2 | #' 3 | #' Supplies insertDotPipeAdin. 4 | #' 5 | #' This package (\url{https://github.com/WinVector/addinexamplesWV}) is a fork of \url{https://github.com/rstudio/addinexamples}. 6 | #' 7 | #' @name addinexamplesWV 8 | #' @docType package 9 | #' @import shiny miniUI rstudioapi formatR 10 | NULL 11 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | 2 | addinexamplesWV_default_options <- list( 3 | addinexamplesWV.usrFn1 = function() { rstudioapi::insertText(" -> ") }, 4 | addinexamplesWV.usrFn2 = function() { rstudioapi::insertText(" := ") }, 5 | addinexamplesWV.usrFn3 = function() { rstudioapi::insertText(" [[ ]] ") } 6 | ) 7 | 8 | .onLoad <- function(libname, pkgname) { 9 | op <- options() 10 | toset <- setdiff(names(addinexamplesWV_default_options), names(op)) 11 | if(length(toset)>0) { 12 | options(addinexamplesWV_default_options[toset]) 13 | } 14 | invisible() 15 | } 16 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | 8 | [This repository](https://github.com/WinVector/addinexamplesWV) is a fork of [RStudio's original](https://github.com/rstudio/addinexamples). 9 | We have renamed the package and removed all other functionality so that this package 10 | does not interfere with installing and using the original package. The original did not provide 11 | the pipe add-in shortcuts we discuss below. 12 | 13 | This package supplies the following [RStudio add-ins](https://rstudio.github.io/rstudioaddins/): 14 | 15 | * **"Insert `%.>%`"** inserts "`%.>%`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["dot arrow pipe"](https://winvector.github.io/wrapr/articles/dot_pipe.html)") 16 | * **"Insert `(.)`"** inserts "`(.)`" ("argument stand-in") 17 | * **"Insert `->.;`"** inserts "`->.;`" (["Bizarro pipe"](http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/)) 18 | * **"Insert `:=`"** inserts "`:=`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["named map builder"](https://winvector.github.io/wrapr/reference/named_map_builder.html)) 19 | * **"Insert `%>.%`"** inserts "`%>.%`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["to dot pipe"](https://winvector.github.io/wrapr/reference/grapes-greater-than-.-grapes.html)") 20 | * **"Insert `%>%`"** inserts "`%>%`" (["Magrittr pipe"](https://CRAN.R-project.org/package=magrittr), also usually available as a separate RStudio editor binding as `Shift-ALT-m`) 21 | * **"Insert `%<>%`"** inserts "`%<>%`" (["Magrittr compound pipe"](https://CRAN.R-project.org/package=magrittr)) 22 | * **"Insert `%<-%`"** inserts "`%<-%`" (["Zeallot assign"](https://CRAN.R-project.org/package=zeallot)) 23 | 24 | The above are useful when bound to keyboard shortcuts in [RStudio](https://www.rstudio.com/products/RStudio/). 25 | 26 | 27 | Installation 28 | ------------ 29 | 30 | The `R` code to install is below. 31 | 32 | We first ensure that you have the latest [CRAN](https://cran.r-project.org) release versions of: 33 | 34 | * [devtools](https://github.com/hadley/devtools) 35 | * [htmltools](https://github.com/rstudio/htmltools) 36 | * [shiny](https://github.com/rstudio/shiny) 37 | * [miniUI](https://github.com/rstudio/miniUI) 38 | * [formatR](https://CRAN.R-project.org/package=formatR) 39 | * [wrapr](https://CRAN.R-project.org/package=wrapr) 40 | 41 | 42 | ```{r eval=FALSE} 43 | install.packages(c("devtools", "htmltools", "shiny", 44 | "miniUI", "formatR", "wrapr")) 45 | ``` 46 | 47 | Then we install this package itself from GitHub: 48 | 49 | ```{r eval=FALSE} 50 | devtools::install_github("WinVector/addinexamples") 51 | ``` 52 | 53 | Finally bind "Insert `%.>%`" to 54 | `F9` (which has a right-facing glyph on some Mac keyboards) via `Tools->Addins->BrowseAddins->KeyboardShortCuts`. 55 | 56 | Use 57 | --- 58 | 59 | Once you have installed and configured all of the above you can press `F9` to "Insert `%.>%`" 60 | where you are typing. "`%.>%`" is the `wrapr` "dot pipe" (an alternative to the [`magrittr`](https://CRAN.R-project.org/package=magrittr) `%>%` pipe). This allows 61 | easy conversion of nested function application into left to right sequential pipe notation. 62 | 63 | For example: 64 | 65 | ```{r} 66 | sin(sqrt(exp(4))) 67 | 68 | library("wrapr") 69 | 70 | 4 %.>% 71 | exp(.) %.>% 72 | sqrt(.) %.>% 73 | sin(.) 74 | ``` 75 | 76 | Dot pipe insists on explicit marking of function arguments with "`.`". 77 | If you also bind "Insert `(.)`" to `F10` typing the above pipelines can become 78 | *very* fast and efficient. 79 | 80 | Basically: 81 | 82 | * You type a function name and then press `F10`. This gives you the template for function arguments which you either leave alone (if the function only takes one argument) or edit to add in the additional arguments you need. This replaces pressing space after you type in a function name. 83 | * You press `F9` when you are done with a pipeline step and then enter or return. 84 | 85 | Try the above in the RStudio editor and the RStudio console, it works really well both places. 86 | 87 | Bizarro pipe can be used the same way as we just used dot pipe (but does not require any package for implementation, 88 | as it is an emergent behavior of pre-existing base-`R` semantics): 89 | 90 | ```{r} 91 | 4 ->.; 92 | exp(.) ->.; 93 | sqrt(.) ->.; 94 | sin(.) 95 | ``` 96 | 97 | Be aware that the value of a Bizarro pipeline comes off the right bottom end of the pipeline (not the 98 | top left end as with dot pipe). So to pick up the Bizarro pipeline value you need to use a right assignment 99 | of the form `->` at the end of the pipeline (or use `{}`). This is, however, one of the features that makes 100 | [Bizarro pipe superior for step debugging](http://www.win-vector.com/blog/2017/01/using-the-bizarro-pipe-to-debug-magrittr-pipelines-in-r/). 101 | 102 | Both of these pipes also work with more complicated function signatures, and with [`dplyr`](https://CRAN.R-project.org/package=dplyr): 103 | 104 | ```{r} 105 | # assuming you have dplyr installed 106 | suppressPackageStartupMessages(library("dplyr")) 107 | 108 | starwars %.>% 109 | group_by(., name) %.>% 110 | summarize(., mean_height = mean(height)) %.>% 111 | ungroup(.) %.>% 112 | left_join(data_frame(name = c("Han Solo", 113 | "Luke Skywalker")), 114 | ., 115 | by = 'name') %.>% 116 | arrange(., desc(name)) 117 | ``` 118 | 119 | Another set of good choices for binding are: 120 | 121 | * `Alt-Enter` for "Insert `%.>%`" (or even `Alt-;`) 122 | * `Alt-Space` for "Insert `(.)`" 123 | * `Alt-=` for "Insert `:=`". 124 | 125 | That way you are treating the argument list as a space-like separator and the pipe 126 | symbol as a line-end-like separator. 127 | 128 | User mappings 129 | ------------- 130 | 131 | Three user controllable add-ins are registered as part of this package: `insert usr1`, 132 | `insert usr2`, and `insert usr3`. The user at run-time can change what function is 133 | called when the add-in is activated. For example to re-bind the first user add-in 134 | to insert `:=` run the following `R` code: 135 | 136 | ```{r eval=FALSE} 137 | options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") }) 138 | ``` 139 | 140 | This allows changing settings without rebuilding the package. 141 | 142 | 143 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [This repository](https://github.com/WinVector/addinexamplesWV) is a fork of [RStudio's original](https://github.com/rstudio/addinexamples). We have renamed the package and removed all other functionality so that this package does not interfere with installing and using the original package. The original did not provide the pipe add-in shortcuts we discuss below. 4 | 5 | This package supplies the following [RStudio add-ins](https://rstudio.github.io/rstudioaddins/): 6 | 7 | - **"Insert `%.>%`"** inserts "`%.>%`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["dot arrow pipe"](https://winvector.github.io/wrapr/articles/dot_pipe.html)") 8 | - **"Insert `(.)`"** inserts "`(.)`" ("argument stand-in") 9 | - **"Insert `->.;`"** inserts "`->.;`" (["Bizarro pipe"](http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/)) 10 | - **"Insert `:=`"** inserts "`:=`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["named map builder"](https://winvector.github.io/wrapr/reference/named_map_builder.html)) 11 | - **"Insert `%>.%`"** inserts "`%>.%`" ([`wrapr`](https://winvector.github.io/wrapr/)'s ["to dot pipe"](https://winvector.github.io/wrapr/reference/grapes-greater-than-.-grapes.html)") 12 | - **"Insert `%>%`"** inserts "`%>%`" (["Magrittr pipe"](https://CRAN.R-project.org/package=magrittr), also usually available as a separate RStudio editor binding as `Shift-ALT-m`) 13 | - **"Insert `%<>%`"** inserts "`%<>%`" (["Magrittr compound pipe"](https://CRAN.R-project.org/package=magrittr)) 14 | - **"Insert `%<-%`"** inserts "`%<-%`" (["Zeallot assign"](https://CRAN.R-project.org/package=zeallot)) 15 | 16 | The above are useful when bound to keyboard shortcuts in [RStudio](https://www.rstudio.com/products/RStudio/). 17 | 18 | Installation 19 | ------------ 20 | 21 | The `R` code to install is below. 22 | 23 | We first ensure that you have the latest [CRAN](https://cran.r-project.org) release versions of: 24 | 25 | - [devtools](https://github.com/hadley/devtools) 26 | - [htmltools](https://github.com/rstudio/htmltools) 27 | - [shiny](https://github.com/rstudio/shiny) 28 | - [miniUI](https://github.com/rstudio/miniUI) 29 | - [formatR](https://CRAN.R-project.org/package=formatR) 30 | - [wrapr](https://CRAN.R-project.org/package=wrapr) 31 | 32 | ``` r 33 | install.packages(c("devtools", "htmltools", "shiny", 34 | "miniUI", "formatR", "wrapr")) 35 | ``` 36 | 37 | Then we install this package itself from GitHub: 38 | 39 | ``` r 40 | devtools::install_github("WinVector/addinexamples") 41 | ``` 42 | 43 | Finally bind "Insert `%.>%`" to `F9` (which has a right-facing glyph on some Mac keyboards) via `Tools->Addins->BrowseAddins->KeyboardShortCuts`. 44 | 45 | Use 46 | --- 47 | 48 | Once you have installed and configured all of the above you can press `F9` to "Insert `%.>%`" where you are typing. "`%.>%`" is the `wrapr` "dot pipe" (an alternative to the [`magrittr`](https://CRAN.R-project.org/package=magrittr) `%>%` pipe). This allows easy conversion of nested function application into left to right sequential pipe notation. 49 | 50 | For example: 51 | 52 | ``` r 53 | sin(sqrt(exp(4))) 54 | ``` 55 | 56 | ## [1] 0.893855 57 | 58 | ``` r 59 | library("wrapr") 60 | 61 | 4 %.>% 62 | exp(.) %.>% 63 | sqrt(.) %.>% 64 | sin(.) 65 | ``` 66 | 67 | ## [1] 0.893855 68 | 69 | Dot pipe insists on explicit marking of function arguments with "`.`". If you also bind "Insert `(.)`" to `F10` typing the above pipelines can become *very* fast and efficient. 70 | 71 | Basically: 72 | 73 | - You type a function name and then press `F10`. This gives you the template for function arguments which you either leave alone (if the function only takes one argument) or edit to add in the additional arguments you need. This replaces pressing space after you type in a function name. 74 | - You press `F9` when you are done with a pipeline step and then enter or return. 75 | 76 | Try the above in the RStudio editor and the RStudio console, it works really well both places. 77 | 78 | Bizarro pipe can be used the same way as we just used dot pipe (but does not require any package for implementation, as it is an emergent behavior of pre-existing base-`R` semantics): 79 | 80 | ``` r 81 | 4 ->.; 82 | exp(.) ->.; 83 | sqrt(.) ->.; 84 | sin(.) 85 | ``` 86 | 87 | ## [1] 0.893855 88 | 89 | Be aware that the value of a Bizarro pipeline comes off the right bottom end of the pipeline (not the top left end as with dot pipe). So to pick up the Bizarro pipeline value you need to use a right assignment of the form `->` at the end of the pipeline (or use `{}`). This is, however, one of the features that makes [Bizarro pipe superior for step debugging](http://www.win-vector.com/blog/2017/01/using-the-bizarro-pipe-to-debug-magrittr-pipelines-in-r/). 90 | 91 | Both of these pipes also work with more complicated function signatures, and with [`dplyr`](https://CRAN.R-project.org/package=dplyr): 92 | 93 | ``` r 94 | # assuming you have dplyr installed 95 | suppressPackageStartupMessages(library("dplyr")) 96 | 97 | starwars %.>% 98 | group_by(., name) %.>% 99 | summarize(., mean_height = mean(height)) %.>% 100 | ungroup(.) %.>% 101 | left_join(data_frame(name = c("Han Solo", 102 | "Luke Skywalker")), 103 | ., 104 | by = 'name') %.>% 105 | arrange(., desc(name)) 106 | ``` 107 | 108 | ## # A tibble: 2 x 2 109 | ## name mean_height 110 | ## 111 | ## 1 Luke Skywalker 172. 112 | ## 2 Han Solo 180. 113 | 114 | Another set of good choices for binding are: 115 | 116 | - `Alt-Enter` for "Insert `%.>%`" (or even `Alt-;`) 117 | - `Alt-Space` for "Insert `(.)`" 118 | - `Alt-=` for "Insert `:=`". 119 | 120 | That way you are treating the argument list as a space-like separator and the pipe symbol as a line-end-like separator. 121 | 122 | User mappings 123 | ------------- 124 | 125 | Three user controllable add-ins are registered as part of this package: `insert usr1`, `insert usr2`, and `insert usr3`. The user at run-time can change what function is called when the add-in is activated. For example to re-bind the first user add-in to insert `:=` run the following `R` code: 126 | 127 | ``` r 128 | options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") }) 129 | ``` 130 | 131 | This allows changing settings without rebuilding the package. 132 | -------------------------------------------------------------------------------- /addinexamplesWV.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | StripTrailingWhitespace: Yes 16 | 17 | BuildType: Package 18 | PackageUseDevtools: Yes 19 | PackageInstallArgs: --no-multiarch --with-keep.source 20 | PackageRoxygenize: rd,collate,namespace,vignette 21 | -------------------------------------------------------------------------------- /docs/LICENSE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | License • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 | 71 | 72 | 73 |
74 | 75 |
76 |
77 | 80 | 81 |
YEAR: 2016
 82 | COPYRIGHT HOLDER: RStudio, Inc.
 83 | 
84 | 85 |
86 | 87 |
88 | 89 | 90 |
91 | 94 | 95 |
96 |

Site built with pkgdown.

97 |
98 | 99 |
100 |
101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Authors • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 | 71 | 72 | 73 |
74 | 75 |
76 |
77 | 80 | 81 |
    82 |
  • 83 |

    Kevin Ushey. Author. 84 |

    85 |
  • 86 |
  • 87 |

    John Mount. Author, maintainer. 88 |

    89 |
  • 90 |
91 | 92 |
93 | 94 |
95 | 96 | 97 |
98 | 101 | 102 |
103 |

Site built with pkgdown.

104 |
105 | 106 |
107 |
108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Wrapr Dot Pipe Add-in • addinexamplesWV 9 | 10 | 11 | 12 | 16 | 17 | 18 |
19 |
47 | 48 | 49 | 50 |
51 |
52 | 53 | 54 | 55 | 56 |
57 | 58 | 59 |

This package supplies the following RStudio add-ins:

60 | 78 |

The above are useful when bound to keyboard shortcuts in RStudio.

79 |
80 |

81 | Installation

82 |

The R code to install is below.

83 |

We first ensure that you have the latest CRAN release versions of:

84 | 92 |
install.packages(c("devtools", "htmltools", "shiny", 
 93 |                    "miniUI", "formatR", "wrapr"))
94 |

Then we install this package itself from GitHub:

95 |
devtools::install_github("WinVector/addinexamples")
96 |

Finally bind “Insert %.>%” to F9 (which has a right-facing glyph on some Mac keyboards) via Tools->Addins->BrowseAddins->KeyboardShortCuts.

97 |
98 |
99 |

100 | Use

101 |

Once you have installed and configured all of the above you can press F9 to “Insert %.>%” where you are typing. “%.>%” is the wrapr “dot pipe” (an alternative to the magrittr %>% pipe). This allows easy conversion of nested function application into left to right sequential pipe notation.

102 |

For example:

103 |
sin(sqrt(exp(4)))
104 |
## [1] 0.893855
105 |
library("wrapr")
106 | 
107 | 4 %.>%
108 |     exp(.) %.>%
109 |     sqrt(.) %.>%
110 |     sin(.)
111 |
## [1] 0.893855
112 |

Dot pipe insists on explicit marking of function arguments with “.”. If you also bind “Insert (.)” to F10 typing the above pipelines can become very fast and efficient.

113 |

Basically:

114 |
    115 |
  • You type a function name and then press F10. This gives you the template for function arguments which you either leave alone (if the function only takes one argument) or edit to add in the additional arguments you need. This replaces pressing space after you type in a function name.
  • 116 |
  • You press F9 when you are done with a pipeline step and then enter or return.
  • 117 |
118 |

Try the above in the RStudio editor and the RStudio console, it works really well both places.

119 |

Bizarro pipe can be used the same way as we just used dot pipe (but does not require any package for implementation, as it is an emergent behavior of pre-existing base-R semantics):

120 |
4 ->.;
121 |     exp(.) ->.;
122 |     sqrt(.) ->.;
123 |     sin(.)
124 |
## [1] 0.893855
125 |

Be aware that the value of a Bizarro pipeline comes off the right bottom end of the pipeline (not the top left end as with dot pipe). So to pick up the Bizarro pipeline value you need to use a right assignment of the form -> at the end of the pipeline (or use {}). This is, however, one of the features that makes Bizarro pipe superior for step debugging.

126 |

Both of these pipes also work with more complicated function signatures, and with dplyr:

127 |
# assuming you have dplyr installed
128 | suppressPackageStartupMessages(library("dplyr"))
129 | 
130 | starwars %.>%
131 |     group_by(., name) %.>%
132 |     summarize(., mean_height = mean(height)) %.>%
133 |     ungroup(.) %.>%
134 |     left_join(data_frame(name = c("Han Solo", 
135 |                                 "Luke Skywalker")), 
136 |             ., 
137 |             by = 'name') %.>%
138 |     arrange(., desc(name))
139 |
## # A tibble: 2 x 2
140 | ##   name           mean_height
141 | ##   <chr>                <dbl>
142 | ## 1 Luke Skywalker        172.
143 | ## 2 Han Solo              180.
144 |

Another set of good choices for binding are:

145 |
    146 |
  • 147 | Alt-Enter for “Insert %.>%” (or even Alt-;)
  • 148 |
  • 149 | Alt-Space for “Insert (.)
  • 150 |
  • 151 | Alt-= for “Insert :=”.
  • 152 |
153 |

That way you are treating the argument list as a space-like separator and the pipe symbol as a line-end-like separator.

154 |
155 |
156 |

157 | User mappings

158 |

Three user controllable add-ins are registered as part of this package: insert usr1, insert usr2, and insert usr3. The user at run-time can change what function is called when the add-in is activated. For example to re-bind the first user add-in to insert := run the following R code:

159 |
options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") })
160 |

This allows changing settings without rebuilding the package.

161 |
162 |
163 |
164 | 165 | 180 | 181 |
182 | 183 | 184 |
187 | 188 |
189 |

Site built with pkgdown.

190 |
191 | 192 |
193 |
194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /docs/jquery.sticky-kit.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net 3 | */ 4 | (function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); 5 | if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, 6 | u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), 8 | a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", 9 | y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/pkgdown.css: -------------------------------------------------------------------------------- 1 | /* Sticker footer */ 2 | body > .container { 3 | display: flex; 4 | padding-top: 60px; 5 | min-height: calc(100vh); 6 | flex-direction: column; 7 | } 8 | 9 | body > .container .row { 10 | flex: 1; 11 | } 12 | 13 | footer { 14 | margin-top: 45px; 15 | padding: 35px 0 36px; 16 | border-top: 1px solid #e5e5e5; 17 | color: #666; 18 | display: flex; 19 | } 20 | footer p { 21 | margin-bottom: 0; 22 | } 23 | footer div { 24 | flex: 1; 25 | } 26 | footer .pkgdown { 27 | text-align: right; 28 | } 29 | footer p { 30 | margin-bottom: 0; 31 | } 32 | 33 | img.icon { 34 | float: right; 35 | } 36 | 37 | img { 38 | max-width: 100%; 39 | } 40 | 41 | /* Section anchors ---------------------------------*/ 42 | 43 | a.anchor { 44 | margin-left: -30px; 45 | display:inline-block; 46 | width: 30px; 47 | height: 30px; 48 | visibility: hidden; 49 | 50 | background-image: url(./link.svg); 51 | background-repeat: no-repeat; 52 | background-size: 20px 20px; 53 | background-position: center center; 54 | } 55 | 56 | .hasAnchor:hover a.anchor { 57 | visibility: visible; 58 | } 59 | 60 | @media (max-width: 767px) { 61 | .hasAnchor:hover a.anchor { 62 | visibility: hidden; 63 | } 64 | } 65 | 66 | 67 | /* Fixes for fixed navbar --------------------------*/ 68 | 69 | .contents h1, .contents h2, .contents h3, .contents h4 { 70 | padding-top: 60px; 71 | margin-top: -60px; 72 | } 73 | 74 | /* Static header placement on mobile devices */ 75 | @media (max-width: 767px) { 76 | .navbar-fixed-top { 77 | position: absolute; 78 | } 79 | .navbar { 80 | padding: 0; 81 | } 82 | } 83 | 84 | 85 | /* Sidebar --------------------------*/ 86 | 87 | #sidebar { 88 | margin-top: 30px; 89 | } 90 | #sidebar h2 { 91 | font-size: 1.5em; 92 | margin-top: 1em; 93 | } 94 | 95 | #sidebar h2:first-child { 96 | margin-top: 0; 97 | } 98 | 99 | #sidebar .list-unstyled li { 100 | margin-bottom: 0.5em; 101 | } 102 | 103 | /* Reference index & topics ----------------------------------------------- */ 104 | 105 | .ref-index th {font-weight: normal;} 106 | .ref-index h2 {font-size: 20px;} 107 | 108 | .ref-index td {vertical-align: top;} 109 | .ref-index .alias {width: 40%;} 110 | .ref-index .title {width: 60%;} 111 | 112 | .ref-index .alias {width: 40%;} 113 | .ref-index .title {width: 60%;} 114 | 115 | .ref-arguments th {text-align: right; padding-right: 10px;} 116 | .ref-arguments th, .ref-arguments td {vertical-align: top;} 117 | .ref-arguments .name {width: 20%;} 118 | .ref-arguments .desc {width: 80%;} 119 | 120 | /* Nice scrolling for wide elements --------------------------------------- */ 121 | 122 | table { 123 | display: block; 124 | overflow: auto; 125 | } 126 | 127 | /* Syntax highlighting ---------------------------------------------------- */ 128 | 129 | pre { 130 | word-wrap: normal; 131 | word-break: normal; 132 | border: 1px solid #eee; 133 | } 134 | 135 | pre, code { 136 | background-color: #f8f8f8; 137 | color: #333; 138 | } 139 | 140 | pre .img { 141 | margin: 5px 0; 142 | } 143 | 144 | pre .img img { 145 | background-color: #fff; 146 | display: block; 147 | height: auto; 148 | } 149 | 150 | code a, pre a { 151 | color: #375f84; 152 | } 153 | 154 | .fl {color: #1514b5;} 155 | .fu {color: #000000;} /* function */ 156 | .ch,.st {color: #036a07;} /* string */ 157 | .kw {color: #264D66;} /* keyword */ 158 | .co {color: #888888;} /* comment */ 159 | 160 | .message { color: black; font-weight: bolder;} 161 | .error { color: orange; font-weight: bolder;} 162 | .warning { color: #6A0366; font-weight: bolder;} 163 | 164 | -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $("#sidebar").stick_in_parent({offset_top: 40}); 3 | $('body').scrollspy({ 4 | target: '#sidebar', 5 | offset: 60 6 | }); 7 | 8 | var cur_path = paths(location.pathname); 9 | $("#navbar ul li a").each(function(index, value) { 10 | if (value.text == "Home") 11 | return; 12 | if (value.getAttribute("href") === "#") 13 | return; 14 | 15 | var path = paths(value.pathname); 16 | if (is_prefix(cur_path, path)) { 17 | // Add class to parent
  • , and enclosing
  • if in dropdown 18 | var menu_anchor = $(value); 19 | menu_anchor.parent().addClass("active"); 20 | menu_anchor.closest("li.dropdown").addClass("active"); 21 | } 22 | }); 23 | }); 24 | 25 | function paths(pathname) { 26 | var pieces = pathname.split("/"); 27 | pieces.shift(); // always starts with / 28 | 29 | var end = pieces[pieces.length - 1]; 30 | if (end === "index.html" || end === "") 31 | pieces.pop(); 32 | return(pieces); 33 | } 34 | 35 | function is_prefix(needle, haystack) { 36 | if (needle.length > haystack.lengh) 37 | return(false); 38 | 39 | for (var i = 0; i < haystack.length; i++) { 40 | if (needle[i] != haystack[i]) 41 | return(false); 42 | } 43 | 44 | return(true); 45 | } 46 | -------------------------------------------------------------------------------- /docs/reference/addinexamplesWV.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | addinexamplesWV — addinexamplesWV • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Supplies insertDotPipeAdin.

    83 | 84 | 85 | 86 |

    Details

    87 | 88 |

    This package (https://github.com/WinVector/addinexamplesWV) is a fork of https://github.com/rstudio/addinexamples.

    89 | 90 | 91 |
    92 | 100 |
    101 | 102 |
    103 | 106 | 107 |
    108 |

    Site built with pkgdown.

    109 |
    110 | 111 |
    112 |
    113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /docs/reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Function reference • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 83 | 84 |
    85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 122 | 123 | 124 | 125 | 128 | 129 | 130 | 131 | 134 | 135 | 136 | 137 | 140 | 141 | 142 | 143 | 146 | 147 | 148 | 149 | 152 | 153 | 154 | 155 | 158 | 159 | 160 | 161 | 164 | 165 | 166 | 167 | 170 | 171 | 172 | 173 |
    95 |

    All functions

    96 |

    97 |
    102 |

    addinexamplesWV

    103 |

    addinexamplesWV

    108 |

    insertArgAddin

    109 |

    Insert (.) .

    114 |

    insertBizzaroPipeAddin

    115 |

    Insert ->.; .

    120 |

    insertColonEqual

    121 |

    Insert := .

    126 |

    insertDotArrowPipeAddin

    127 |

    Insert %.>% .

    132 |

    insertMagrittrCompoundPipeAddin

    133 |

    Insert %<>% .

    138 |

    insertMagrittrPipeAddin

    139 |

    Insert %>% .

    144 |

    insertToDotPipeAddin

    145 |

    Insert %>.% .

    150 |

    insertUsr1Addin

    151 |

    Insert user chosen text or operation.

    156 |

    insertUsr2Addin

    157 |

    Insert user chosen text or operation.

    162 |

    insertUsr3Addin

    163 |

    Insert user chosen text or operation.

    168 |

    insertZeallotArrow

    169 |

    Insert %<-% .

    174 |
    175 |
    176 | 177 | 183 |
    184 | 185 |
    186 | 189 | 190 |
    191 |

    Site built with pkgdown.

    192 |
    193 | 194 |
    195 |
    196 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /docs/reference/insertArgAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert (.) . — insertArgAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert (.) at the cursor position.

    83 | 84 | 85 |
    insertArgAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertBizzaroPipeAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert ->.; . — insertBizzaroPipeAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert ->.; (Bizarro Pipe, http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/) at the cursor position.

    83 | 84 | 85 |
    insertBizzaroPipeAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertColonEqual.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert := . — insertColonEqual • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert := (Named map builder, https://winvector.github.io/wrapr/reference/named_map_builder.html) at the cursor position.

    83 | 84 | 85 |
    insertColonEqual()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertDotArrowPipeAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert %.>% . — insertDotArrowPipeAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert %.>% (dot pipe, https://winvector.github.io/wrapr/articles/dot_pipe.html) at the cursor position.

    83 | 84 | 85 |
    insertDotArrowPipeAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertMagrittrCompoundPipeAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert %<>% . — insertMagrittrCompoundPipeAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert %<>% (Magrittr pipe, https://github.com/tidyverse/magrittr) at the cursor position.

    83 | 84 | 85 |
    insertMagrittrCompoundPipeAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertMagrittrPipeAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert %>% . — insertMagrittrPipeAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert %>% (Magrittr pipe, https://CRAN.R-project.org/package=magrittr) at the cursor position.

    83 | 84 | 85 |
    insertMagrittrPipeAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertToDotPipeAddin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert %>.% . — insertToDotPipeAddin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert %>.% (dot pipe, https://winvector.github.io/wrapr/reference/grapes-greater-than-.-grapes.html) at the cursor position.

    83 | 84 | 85 |
    insertToDotPipeAddin()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 |
    98 | 101 | 102 |
    103 |

    Site built with pkgdown.

    104 |
    105 | 106 |
    107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/reference/insertUsr1Addin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert user chosen text or operation. — insertUsr1Addin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert user chosen text or operation at the cursor position. 83 | To set the option do something like the example.

    84 | 85 | 86 |
    insertUsr1Addin()
    87 | 88 | 89 |

    Examples

    90 |
    91 | # options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") }) 92 | 93 |
    94 |
    95 | 103 |
    104 | 105 |
    106 | 109 | 110 |
    111 |

    Site built with pkgdown.

    112 |
    113 | 114 |
    115 |
    116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/reference/insertUsr2Addin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert user chosen text or operation. — insertUsr2Addin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert user chosen text or operation at the cursor position. 83 | To set the option do something like the example.

    84 | 85 | 86 |
    insertUsr2Addin()
    87 | 88 | 89 |

    Examples

    90 |
    91 | # options("addinexamplesWV.usrFn2" = function() { rstudioapi::insertText(" := ") }) 92 | 93 |
    94 |
    95 | 103 |
    104 | 105 |
    106 | 109 | 110 |
    111 |

    Site built with pkgdown.

    112 |
    113 | 114 |
    115 |
    116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/reference/insertUsr3Addin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert user chosen text or operation. — insertUsr3Addin • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert user chosen text or operation at the cursor position. 83 | To set the option do something like the example.

    84 | 85 | 86 |
    insertUsr3Addin()
    87 | 88 | 89 |

    Examples

    90 |
    91 | # options("addinexamplesWV.usrFn3" = function() { rstudioapi::insertText(" := ") }) 92 | 93 |
    94 |
    95 | 103 |
    104 | 105 |
    106 | 109 | 110 |
    111 |

    Site built with pkgdown.

    112 |
    113 | 114 |
    115 |
    116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/reference/insertZeallotArrow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Insert %<-% . — insertZeallotArrow • addinexamplesWV 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 |
    42 | 71 | 72 | 73 |
    74 | 75 |
    76 |
    77 | 80 | 81 | 82 |

    Call this function as an addin to insert %<-% (Zeallot Arrow, https://CRAN.R-project.org/package=zeallot) at the cursor position.

    83 | 84 | 85 |
    insertZeallotArrow()
    86 | 87 | 88 |
    89 | 95 |
    96 | 97 | 107 |
    108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /inst/rstudio/addins.dcf: -------------------------------------------------------------------------------- 1 | Name: Insert %.>% 2 | Description: Inserts %.>% (wrapr dot arrow pipe) at the cursor position. 3 | Binding: insertDotArrowPipeAddin 4 | Interactive: false 5 | 6 | Name: Insert (.) 7 | Description: Inserts (.) (argument stand-in) at the cursor position. 8 | Binding: insertArgAddin 9 | Interactive: false 10 | 11 | Name: Insert ->.; 12 | Description: Inserts ->.; (Bizarro pipe) at the cursor position. 13 | Binding: insertBizzaroPipeAddin 14 | Interactive: false 15 | 16 | Name: Insert %>.% 17 | Description: Inserts %>.% (wrapr to dot pipe) at the cursor position. 18 | Binding: insertToDotPipeAddin 19 | Interactive: false 20 | 21 | 22 | Name: Insert %>% 23 | Description: Inserts %>% (Magrittr pipe) at the cursor position. 24 | Binding: insertMagrittrPipeAddin 25 | Interactive: false 26 | 27 | Name: Insert %<>% 28 | Description: Inserts %<>% (Magrittr compound pipe) at the cursor position. 29 | Binding: insertMagrittrCompoundPipeAddin 30 | Interactive: false 31 | 32 | Name: Insert := 33 | Description: Inserts := at the cursor position. 34 | Binding: insertColonEqual 35 | Interactive: false 36 | 37 | Name: Insert %<-% 38 | Description: Inserts %<-% (zeallot assign) at the cursor position. 39 | Binding: insertZeallotArrow 40 | Interactive: false 41 | 42 | Name: Insert usr1 43 | Description: Inserts user chosen text at the cursor position. 44 | Binding: insertUsr1Addin 45 | Interactive: false 46 | 47 | Name: Insert usr2 48 | Description: Inserts user chosen text at the cursor position. 49 | Binding: insertUsr2Addin 50 | Interactive: false 51 | 52 | Name: Insert usr3 53 | Description: Inserts user chosen text at the cursor position. 54 | Binding: insertUsr3Addin 55 | Interactive: false 56 | 57 | -------------------------------------------------------------------------------- /man/addinexamplesWV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/package.R 3 | \docType{package} 4 | \name{addinexamplesWV} 5 | \alias{addinexamplesWV} 6 | \alias{addinexamplesWV-package} 7 | \title{addinexamplesWV} 8 | \description{ 9 | Supplies insertDotPipeAdin. 10 | } 11 | \details{ 12 | This package (\url{https://github.com/WinVector/addinexamplesWV}) is a fork of \url{https://github.com/rstudio/addinexamples}. 13 | } 14 | -------------------------------------------------------------------------------- /man/insertArgAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertArgAddin.R 3 | \name{insertArgAddin} 4 | \alias{insertArgAddin} 5 | \title{Insert (.) .} 6 | \usage{ 7 | insertArgAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{(.)} at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertBizzaroPipeAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertBizzaroPipeAddin.R 3 | \name{insertBizzaroPipeAddin} 4 | \alias{insertBizzaroPipeAddin} 5 | \title{Insert ->.; .} 6 | \usage{ 7 | insertBizzaroPipeAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{->.;} (Bizarro Pipe, \url{http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertColonEqual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertColonEqual.R 3 | \name{insertColonEqual} 4 | \alias{insertColonEqual} 5 | \title{Insert := .} 6 | \usage{ 7 | insertColonEqual() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{:=} (Named map builder, \url{https://winvector.github.io/wrapr/reference/named_map_builder.html}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertDotArrowPipeAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertDotArrowPipeAddin.R 3 | \name{insertDotArrowPipeAddin} 4 | \alias{insertDotArrowPipeAddin} 5 | \title{Insert \%.>\% .} 6 | \usage{ 7 | insertDotArrowPipeAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{\link[wrapr]{\%.>\%}} (dot pipe, \url{https://winvector.github.io/wrapr/articles/dot_pipe.html}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertMagrittrCompoundPipeAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertMagrittrCompoundPipeAddin.R 3 | \name{insertMagrittrCompoundPipeAddin} 4 | \alias{insertMagrittrCompoundPipeAddin} 5 | \title{Insert \%<>\% .} 6 | \usage{ 7 | insertMagrittrCompoundPipeAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{\link[magrittr]{\%<>\%}} (Magrittr pipe, \url{https://github.com/tidyverse/magrittr}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertMagrittrPipeAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertMagrittrPipeAddin.R 3 | \name{insertMagrittrPipeAddin} 4 | \alias{insertMagrittrPipeAddin} 5 | \title{Insert \%>\% .} 6 | \usage{ 7 | insertMagrittrPipeAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{\link[magrittr]{\%>\%}} (Magrittr pipe, \url{https://CRAN.R-project.org/package=magrittr}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertToDotPipeAddin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertToDotPipeAddin.R 3 | \name{insertToDotPipeAddin} 4 | \alias{insertToDotPipeAddin} 5 | \title{Insert \%>.\% .} 6 | \usage{ 7 | insertToDotPipeAddin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{\link[wrapr]{\%>.\%}} (dot pipe, \url{https://winvector.github.io/wrapr/reference/grapes-greater-than-.-grapes.html}) at the cursor position. 11 | } 12 | -------------------------------------------------------------------------------- /man/insertUsr1Addin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertUsrAddin.R 3 | \name{insertUsr1Addin} 4 | \alias{insertUsr1Addin} 5 | \title{Insert user chosen text or operation.} 6 | \usage{ 7 | insertUsr1Addin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert user chosen text or operation at the cursor position. 11 | To set the option do something like the example. 12 | } 13 | \examples{ 14 | 15 | # options("addinexamplesWV.usrFn1" = function() { rstudioapi::insertText(" := ") }) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /man/insertUsr2Addin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertUsrAddin.R 3 | \name{insertUsr2Addin} 4 | \alias{insertUsr2Addin} 5 | \title{Insert user chosen text or operation.} 6 | \usage{ 7 | insertUsr2Addin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert user chosen text or operation at the cursor position. 11 | To set the option do something like the example. 12 | } 13 | \examples{ 14 | 15 | # options("addinexamplesWV.usrFn2" = function() { rstudioapi::insertText(" := ") }) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /man/insertUsr3Addin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertUsrAddin.R 3 | \name{insertUsr3Addin} 4 | \alias{insertUsr3Addin} 5 | \title{Insert user chosen text or operation.} 6 | \usage{ 7 | insertUsr3Addin() 8 | } 9 | \description{ 10 | Call this function as an addin to insert user chosen text or operation at the cursor position. 11 | To set the option do something like the example. 12 | } 13 | \examples{ 14 | 15 | # options("addinexamplesWV.usrFn3" = function() { rstudioapi::insertText(" := ") }) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /man/insertZeallotArrow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/insertZeallotArrow.R 3 | \name{insertZeallotArrow} 4 | \alias{insertZeallotArrow} 5 | \title{Insert \%<-\% .} 6 | \usage{ 7 | insertZeallotArrow() 8 | } 9 | \description{ 10 | Call this function as an addin to insert \code{\%<-\%} (Zeallot Arrow, \url{https://CRAN.R-project.org/package=zeallot}) at the cursor position. 11 | } 12 | --------------------------------------------------------------------------------