Using RBridge from Lite-C to get to R & then SQL tables & store procedures is one way.

https://manual.zorro-project.com/rbridge.htm
https://support.rstudio.com/hc/en-us/articles/214510788-Setting-up-R-to-connect-to-SQL-Server-

If there is ANOTHER way, please kindly share that info.
Thanks