0

For some reason, R will recognize %>% (pipe operator) but not the %<>% (compound assignment pipe). The error I get is 'could not find function "%<>%"' - any ideas on how to fix this?

Tim
  • 81
  • 6
  • 2
    `%>%` from the magrittr package is loaded with `dplyr` and other `tidyverse` packages, but `%<>%` from magrittr is not. – Jon Spring May 19 '23 at 18:09

1 Answers1

4

Load magrittr

library(magrittr)
x <- 4
x %<>% sqrt
x
## [1] 2

Note that overwriting variables can make debugging more difficult.

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341