Why are `colMeans()` and `rowMeans()` functions faster than using the mean function with `lapply()`?

前端 未结 2 1118
你的背包
你的背包 2021-01-14 12:17

What I want to ask is, algorithmically, what do the rowMeans() and colMeans() functions do to optimize speed?

2条回答
  •  独厮守ぢ
    2021-01-14 12:59

    rowMeans and colMeans are faster than because they call C code directly, rather than being interpreted by the R interpreter.

提交回复
热议问题