Run the Visual Studio installer and select the Modify option (for details, see Modify Visual Studio). Visual Studio Shell lacks the necessary components for RTVS. RTVS does not install if you have only the Visual Studio Shell that's included with products such as Visual Studio Test Professional and SQL Server Management Studio. RTVS is not presently supported on Visual Studio for Mac. R Tools for Visual Studio (RTVS) is supported on Windows with the Community (free), Professional, and Enterprise editions of both Visual Studio 2017 and Visual Studio 2015 Update 3 (or higher) (direct download).
After installing R Tools, you may want to configure Visual Studio for an optimized data scientist layout, as described on the Options article.