extract

0th

Percentile

Aliases

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

Details

Currently implemented aliases are

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

Aliases
  • add
  • and
  • divide_by
  • divide_by_int
  • equals
  • extract
  • extract2
  • inset
  • inset2
  • is_greater_than
  • is_in
  • is_less_than
  • is_weakly_greater_than
  • is_weakly_less_than
  • mod
  • multiply_by
  • multiply_by_matrix
  • n'est pas
  • not
  • or
  • raise_to_power
  • set_colnames
  • set_names
  • set_rownames
  • subtract
  • use_series
Examples
library(magrittr) iris %>% extract(, 1:4) %>% head good.times <- Sys.Date() %>% as.POSIXct %>% seq(by = "15 mins", length.out = 100) %>% data.frame(timestamp = .) good.times$quarter <- good.times %>% use_series(timestamp) %>% format("%M") %>% as.numeric %>% divide_by_int(15) %>% add(1)
Documentation reproduced from package magrittr, version 1.5, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.