Is it possible to chain functions in R?
Sample data:
m <- matrix(c(1:10, 11:20), nrow = 10, ncol = 2)
For example, I would like to r
I would use the magrittr package. It has a "pipe" operator that takes the result of one function and passes it in as an argument to the next:
magrittr
m <- matrix(c(1:10, 11:20), nrow = 10, ncol = 2) m %>% mean %>% sum
Ceci n'est pas un pipe!