aliases: Aliases

Description Details Examples

Description

nestpas provides a series of aliases which can be more pleasant to use when composing chains using magrittr's %>% operator.

Details

Currently implemented aliases are

add `+`
and `&`
divide_by `/`
divide_by_int `%/%`
equals `==`
extract `[`
extract2 `[[`
inset `[<-`
inset2 `[[<-`
is_in `%in%`
is_greater_than `>`
is_less_than `<`
is_weakly_greater_than `>=`
is_weakly_less_than `<=`
mod `%%`
multiply_by `*`
multiply_by_matrix `%*%`
not (`n'est pas`) `!`
or `|`
raise_to_power `^`
set_attr `attr<-`
set_attributes `attributes<-`
set_colnames `colnames<-`
set_comment `comment<-`
set_class `class<-`
set_dim `dim<-`
set_names `names<-`
set_rownames `rownames<-`
subtract `-`
use_series `$`

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
iris %>% extract(, 1:4) %>% head

iris %>% inset("Row.Number", value = 1:NROW(.))

iris %>% inset(150, "Sepal.Length", value = NA_real_)

sample(c(NA, 1), 10, replace = TRUE) %>% is.na %>% not %>% sum

1:10 %>% set_names(letters[1:10])

1:16 %>% set_attr("dim", c(4, 4))

smbache/nestpas documentation built on May 30, 2019, 5:02 a.m.