snippet_pipe_check: Snippet Pipe Check

Description Usage Arguments Value Examples

View source: R/Snippet_Pipe_Check.R

Description

Decides whether or not to insert a pipe as well during snippet insertion.

Usage

1
snippet_pipe_check(afterStr = "", elseStr = "", pipeStr = "%>% ")

Arguments

afterStr

Text to insert after the pipe (character scalar).

elseStr

Text to insert if no pipe is needed (character scalar).

pipeStr

The pipe to insert if needed (character scalar).

Value

The deleted code (character scalar).

Examples

1
2
3
4
5
6
7
# Set up a snippet as:
# snippet mu
# `r KO:::snippet_pipe_check();`mutate(${0})

# Then type "mtcars mu", & run the add-in function
# Or type "mtcars %>% mu", & run the add-in function
# The output for both will be "mtcars %>% mutate()"

KO112/KO documentation built on Oct. 2, 2020, 9:21 a.m.