Hello,
Got it working with R4.0.3 and R.4.1.1.
Install R with admin rights
Start C:\Program Files\R\R-4.1.1\bin\x64\R.exe with admin rights
install.packages("Rcpp", dependencies = TRUE, lib="C:\Program Files\R\R-4.1.1\library");
pick a repo and install
Add 'C:\Program Files\R\R-4.1.1\bin\x64' (wh quotes) to PATH
Create System variable R_HOME 'C:\Program Files\R\R-4.1.1' (wh quotes)
start CMD with admin rights:
icacls "C:\Program Files\R\R-4.1.1" /grant "NT Service\MSSQLLAUNCHPAD":(OI)(CI)RX /T
icacls "C:\Program Files\R\R-4.1.1" /grant *S-1-15-2-1:(OI)(CI)RX /T
Restart Launchpad service
CREATE EXTERNAL LANGUAGE [HR]
FROM (
CONTENT = N'C:\temp\110R-lang-extension-windows-release.zip'
, FILE_NAME = 'libRExtension.dll'
);
test with:
EXEC sp_execute_external_script
@language =N'HR',
@script=N'
print(R.home());
print(file.path(R.home("bin"), "R"));
print(R.version);
print("Hello RExtension!");'
;
That's it.
In short read the docs at:
https://learn.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-r
Greetings
Harry