2

I used following:

<<JLink`;
InstallJava[];
ReinstallJava[JVMArguments->(*"-Xmx1024m"*)(*"-Xmx2048m"*)(*"-Xmx4096m"*)"-Xmx8192m"];

rPath="C:\\Program Files\\R\\R-3.3.0";

InstallR["RHomeLocation"->rPath,"RVersion"->"3.3.0","JRELocation"->"D:\\Program Files\\Wolfram Research\\Mathematica\\11.1\\SystemFiles\\Java\\Windows-x86-64\\bin\\javaw.exe -Xmx8192m"]
REvaluate["1+1"]

REvaluate["library(RODBC)"];

REvaluate["sink(\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\Muhammad Ali\\\\output.txt\")"]


REvaluate["channel <- odbcDriverConnect(\"Driver={SQL Server};Server=xxxx;Database=xxxx;uid=xxxx;pwd=xxxx\")"]

REvaluate["med <- sqlQuery(channel, \"SELECT Count_OP, Count_IP, age_group, nationality_group, Gender, class_room_type, LOG(exposure_2017_2018) AS 'log_exposure_2017_2018' FROM xxxx.dbo.per_person_records WHERE class_room_type NOT IN('MG3-Suit','MG8-Semi Private')\")"];

REvaluate["med$Count_OP[is.na(med$Count_OP)] <- 0"];
REvaluate["med$Count_IP[is.na(med$Count_IP)] <- 0"];

Then get the following error in the picture below:

enter image description here

Please help what should i do? Btw if i run this directly in R it works fine.

user13892
  • 9,375
  • 1
  • 13
  • 41
  • 3
    RLink developer here. Looks like some of the operations you tried did crash the JVM where R has been dynamically loaded into. Can't provide any quick advice until the problem is better diagnosed. I will look into this, as time permits. If you could provide some sample db / code, reproducing the issue (e.g. SQLite file or an sql script to generate MS SQL db), that would be very helpful. – Leonid Shifrin Sep 16 '18 at 20:39
  • @LeonidShifrin the data belong to a client and is confidential but i will try to see if i can replicate the issue in other dataset that i can share. – user13892 Sep 18 '18 at 11:24
  • Thanks, that would be helpful. – Leonid Shifrin Sep 18 '18 at 12:31

0 Answers0