Magrittr %>% Operator to change the dimensions of a Matrix

Viewed 277

I am making my baby steps with the %>% operator in R. It is extremely useful, but sometimes I get stuck on what must be simple stuff.

Consider the following example:

mm<-matrix(nrow=4, ncol=5, seq(20))
dim(mm)<-NULL

which I use to flatten a matrix. How can I flatten mm using %>%?

4 Answers
Related