2010/02/25

Tips for enhance R code

After reading Writing Efficient Programs in R and R Code optimization and Packages Creation, 3 tips by now.
1. avoid data frame (from 2nd)

2. ifelse is slower than if () { } else { } (from 1st)

3. aovid using rbind, cbind in loops, predifine a NA array or matrix(from 2nd)


Examples:

CC Copyright

創用 CC 授權條款
本著作由Chunhung Chou製作,以創用CC 姓名標示-相同方式分享 3.0 Unported 授權條款釋出。