Because of security, you cannot just call the install.packages() R function from the sys.sp_exacute_external_script system procedure on the server side. There are many other ways to do it. You can find the complete list of options for installing R packages in the article Install new R packages on SQL Server at https://docs.microsoft.com/en-us/sql/advanced-analytics/r/install-additional-r-packages-on-sql-server?view=sql-server-2017. I will just show one option here, the one I am using when writing this book. I have my SQL Server installed on a virtual machine, and I can enable a web connection for the machine. Then the process of installing an additional R package is simple. You just need to run the R console, R.exe, from the ML Services (In-Database) installation, which is located in the C:\Program Files\Microsoft...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia