It is from magrittr
. It is called as assignment operator which does update the original object without doing. It's functionality is similar to the data.table
:=
(though this may less efficient compared to data.table as data.table uses pass by reference assignment)
mtcars <- mtcars %>%
mutate(qsec = as.integer(qsec))
i.e. the %>%
doesn't update the original object. It just prints the output to the console
mtcars %>%
mutate(qsec = as.integer(qsec))
The class of qsec
remains the same
class(mtcars$qsec)
[1] "numeric"
But, if we do the %<>%
, we don't need to update with <-
mtcars %<>%
mutate(qsec = as.integer(qsec))
class(mtcars$qsec)
[1] "integer"