I usually can initiate R from the R folder whchi download form the official site. However, if I would like to initiate R in the Anaconda environment, it didn't work. The following scripts as an example.
//Works
Set Environment Variable( "R_HOME", "C:\Users\UserName\Documents\R\R-3.6.1");
R init();
//TKIntRJMP.R version 14.0
//0
R term();
<BR />
//Error
Set Environment Variable( "R_HOME", "C:\Users\UserName\AppData\Local\Continuum\anaconda3\envs\rstudio-1.1.456\lib\R");
R init();
//DLL:"C:\Users\UserName\AppData\Local\Continuum\anaconda3\envs\rstudio-1.1.456\lib\R\bin\x64\R.dll"
//-1<BR />R term();
Did I set the wrong directory or miss any commends in the code?