Zero-length Vector Issue in R

Posted on Apr 10, 2017 in Programming • Tagged with programming, CRAN, R, issue, trick, trap, vector, zero-length, 0-length

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

The corner case of 0-length vectors is not well considered in R. It causes issues in several situations. First, 1:n is probably not what you want …


Continue reading

Call Java in R Using Package rJava

Posted on Jun 23, 2012 in Computer Science • Tagged with programming, Java, array, rJava, R, vector, package

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

The package "rJava" offers a convenient way to call Java code from R. The following are some tips for using the "rJava" package.

  1. You must first start …


Continue reading

Data Structure in R

Posted on Nov 09, 2010 in Programming • Tagged with programming, list, data structure, container, matrix, vector, R, CRAN

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **

Vector, Matrix and Array …


Continue reading

Keep Matrix Structure when Extract a Row/Column from a Matrix

Posted on Aug 14, 2012 in Programming • Tagged with programming, data structure, algebra, matrix, R, vector, CRAN

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

I talked in the post Abuse of Vector in R that it is often the case that we want keep the matrix sturcture when extracting a row …


Continue reading

Easy Made Mistakes when Writing R code

Posted on Jun 14, 2012 in Programming • Tagged with vector, operator, mistake, programming, R, CRAN

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Being flexible is a two-side sword to R. While it make it convenient and productive to use R, it is also very easy to make mistakes when …


Continue reading