Reputation: 288
I have been banging my head on this one for a day or two. Trying to run some analysis through 'mlr' and I'm getting stuck on a package install error. Specifically, I am trying to run:
im_feat <- generateFilterValuesData(trainTask, method = c("information.gain","chi.squared"))
My initial run of this code generated the following error:
Error in loadNamespace(name) : there is no package called ‘FSelector’
Smart guy that I am, I decided to install FSelector. However, when I did...it would bomb when it tried to load the dependency 'RWeka'. Specially, I got the following error:
Error : .onLoad failed in loadNamespace() for 'RWeka', details:
call: .jnew("weka.core.WekaPackageManager")
error: java.lang.UnsupportedClassVersionError:weka/core/WekaPackageManager : Unsupported major.minor version 51.0
Error: loading failed
Execution halted
I have been digging on this for a day or so. Here are the things I've already done:
Made sure JAVA_HOME was pointing to the correct place as follows:
Sys.setenv(JAVA_HOME='~/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home')
Any ideas are sincerely welcome!
Upvotes: 2
Views: 2067
Reputation: 288
Never got an answer, but I was able to fix this. For the sake of completeness, I figured I'd post what worked for me in case anyone else has this problem and finds this question.
Step 1: Terminal
$ sudo R CMD javareconf
Step 2: Back in RStudio
install.packages("rJava",type = "source")
install.packages("RWeka")
FSelector and all related packages have been loading and working fine after this.
Upvotes: 2