Run the following command from an elevated command prompt to install only Microsoft Machine Learning Server (Standalone) and its prerequisites.
Setup.exe /q /ACTION=Install /FEATURES=SQL_SHARED_MR /IACCEPTROPENLICENSETERMS /IACCEPTSQLSERVERLICENSETERMS
Source: Install Microsoft R Server from the Command Line | Microsoft Docs
This article provides a comprehensive list of the tutorials, demos, and sample applications that use machine learning features in SQL Server 2016 or SQL Server 2017. Start here to learn how to run R or Python from T-SQL, use remote and local compute contexts, and optimize your R and Python code for a SQL production environment:
Source: SQL Server Machine Learning Tutorials | Microsoft Docs