I like working with R in a SQLServer environment. You sometimes you have situations where developing certain data manipulations is a hassle in T-SQL. Specifically when you want to do advanced string manipulations or complex regex lookups. In such a case using the stringi package could provide a huge help.
It is not too difficult to built in checks if the code is begin run from the server or local from within your R-Studio environment. Just check if the InputDataSet exist.
In this way you can easily deploy your R-code to the server using your preferred version control software.