microsoft / RTVS

R Tools for Visual Studio.
MIT License
388 stars 118 forks source link

Call R from Visual Studio C++ #4348

Closed vivanov879 closed 5 years ago

vivanov879 commented 5 years ago

Hi. What's the best way to call R functions from Visual Studio C++? Is it to use https://github.com/Microsoft/R-Host ? I read that neither RInside nor RCpp support visual studio.

vivanov879 commented 5 years ago

Another option might be to use https://github.com/rstudio/websocket. Suppose the use case consists of couple scenarios. For example, C++ gets data and wants to do some maths in R every minute. Then, C++ will send some data to R, R will process it and send back. Sounds like a neat solution.

MikhailArkhipov commented 5 years ago

Basically load R.dll and call it :-). https://github.com/Microsoft/R-Host for example.

MikhailArkhipov commented 5 years ago

If you want to run it out of proc, you can try and use something similar to API I have in C# https://github.com/Microsoft/RTVS/tree/master/src/Host/API/Impl

vivanov879 commented 5 years ago

Thanks