I have the sqldf code below to merge two data frames. I understand I need the RH2
package. I pasted the error onto google to find solutions but most of the solutions listed is because of people being unable to download the rJava
library. Do I absolutely need that library or can I run the code below without the rJava library? I'm waiting on my system admin to help me install java as I'm not allowed to. Solutions I've found 1 and 2 . If there's alternatives I can do or use for sqldf to get the code to run, please let me know.
library(sqldf)
library(RH2)
nr1 <- 100
nc1 <- 4682
df1 <- as.data.frame(matrix(seq_len(nr1*nc1), nr1))
nr2 <- 100
nc2 <- 4903
df2 <- as.data.frame(matrix(seq_len(nr2*nc2), nr2))
options(sqldf.driver = "H2")
res <- sqldf("select * from df1 a
left join df2 b on a.V1 = b.V1
and a.V2 between b.V3 and b.V4")
ERROR:
Loading required package: RJDBC
Loading required package: rJava
java.home option:
JAVA_HOME environment variable: D:\Ash\Java\jre7
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package ‘rJava’ could not be loaded
In addition: Warning message:
In fun(libname, pkgname) :
Java home setting is INVALID, it will be ignored.
Please do NOT set it unless you want to override system settings.
Error in !dbPreExists : invalid argument type