I just installed SQL Server 2016 Developer and included R Server and R Services to get installed as well. Everything installed correctly except the R Server and R Services. The log file contained this:
2016-07-29T17:07:39 INFO Command invoked: D:\x64\RSetup.exe /install /component SRS /version 8.0.3 /language 1033 /destdir C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\R_SERVICES /logfile C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20160729_125230\RSetup.log /instance MSSQLSERVER
2016-07-29T17:07:39 INFO Using default cache dir: C:\Users\fs103799\AppData\Local\Temp\
2016-07-29T17:07:39 INFO Backing up source dir: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\R_SERVICES\ => C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\R_SERVICES_63975911-f850-4ad1-bf7c-21adf0f9ba6d
2016-07-29T17:07:39 ERROR Error renaming source dir: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\R_SERVICES\' is denied.
2016-07-29T17:07:39 INFO Exiting with code 5
I have no idea why the access to the path was denied. The path exists and there are files there. So the install process was able to store files there, but then couldn't access the folder.
Best Answer
Add the SQLRUsergroup to the LogOnLocally user right assignment. You might have to create the SQLRUsergroup if it does not already exist. Ensure the logon used to execute setup is a local admin on the box.