- 2
- 0
- 约5.89千字
- 约 24页
- 2017-09-16 发布于湖北
- 举报
R工程实践与
Data Scientist
阿稳@douban
2013.05.19 于第6届R语言会议
当R面临大数据量
Copy-on-modify
semantics
• 案例
• loop - 向量化运算(apply, 矩阵运算)
• apply - c/cpp
The art of R performance improvement is to
build up a good intuitions for what operations
incur a copy, and what occurs in place.
-- /hadley/devtools/wiki/Profiling
稀疏矩阵M的每⼀列非零元素减去该列的均值
library(Matrix)
...
N = M
N@x = 1
S = N %*% Diagonal(colSums(M)/colSums(N))
M = M - S
for (i in nrow(M))
原创力文档

文档评论(0)