There is a command
shutdown in both Windows and Linux,
and this function uses it to shut down a computer.
After the time
wait has passed, R will execute
shutdown -s -t 0 (for Windows) or
shutdown -h now to shut down the computer.
This function is a modified version of Yihui's shutdown function from the fun package.
os.shutdown(s = 0, m = 0, h = 0)
time to wait before shutting down (in seconds), added to m and h; passed to
time to wait before shutting down (in minutes), added to s and h; passed to
time to wait before shutting down (in hours), added to s and m; passed to
The status code of
Yihui Xie <http://yihui.name>, and Tal Galili
1 2 3 4 5 6 7 8 9
## Not run: ## when your code is extremely time-consuming, # you may need this function; # e.g. you wish to go to sleep, while keeping R running long computation... os.shutdown() ## the next day you wake up, "thank you, R" :) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.