Restart the RStudio R session.
restartSession(command = "")
command
An R command (as a string) to be run after restarting R.
The restartSession function was added in version 1.1.281 of RStudio.
restartSession