codetools

Code analysis and parallelizing vector operations in R. Possibilities of static code analysis of S-language scripts are discussed. The author presents the codetools package for R software which checks the code for such issues as defined but not used variables, non-existent arguments in function calls, and so on. The other topic of the paper is the parallelization of vector operations in R. The author discusses especially the case of dual core processors and mentions that the parallelization will only pay when the vector length n is large enough and the performed function is computationally expensive. In his experiments n≈4 appeared to be sufficient to warrant parallel computation of such functions as qbet, but functions like qnorm require n≈400, and for basic arithmetic operations n≈30·000. So a preliminary code analysis is needed for efficient parallelization together with the analysis of specific hardware and operation system capabilities.