I have a few work flows where I would like R to halt the Linux machine it\'s running on after completion of a script. I can think of two similar ways to do this:
system("echo 'rootpassword' | sudo halt")
However, the downside is having your root password in plain text in the script.