Category:Common errors, and how to fix it.

This guide includes errors encountered when programming in R, and how to fix it.

Error. onLoad failed in loadNamespace for 'rJava', details: ...
This error usually occurs when using rJava package on a 64 bit machine with 32 bit version of Java. To fix this, install java 64 bit version.

Error in loadNamespace(name) : there is no package called ‘xxx’
This error is pretty straightforward, since it occurs when a package is missing. To fix this, install a missing package.

Noted that, even when you tell the program to install all dependencies, some dependent packages may not be installed properly. This happened with e1071 package missing.

Error when loading ARFF files
There are 2 possible ways that I used to load ARFF files: read.arff in foreign package, and read.arff in RWeka package. If you export an arff file from Weka, sometimes you will not be able to load that arff file to R using read.arff in foreign package. To fix this, use read.arff in RWeka package instead.