As noted by just about every response to this thread, removing the "potentially harmful" calls in the R language would:
- Be potentially impossible to do completely.
- Be difficult to do without spending significant time writing complicated (i.e. ugly) hacks.
- Kneecap the language by removing a ton of functionality that makes R so flexible.
A safer solution that doesn't require modifying/rewriting large parts of the R language would be to run R inside a jail using something like BSD Jails, Jailkit or Solaris Zones.
Many of these solutions allow the jailed process to exercise root-like privileges but restrict the areas of the computer that the process can operate on.
A disposable virtual machine is another option. If a privileged user thrashes the virtual environment, just delete it and boot another copy.