A central function to run functions for shutting down, restarting, sleeping (etc.) your computer. This will run these functions immediately.

os.manage(GUI = TRUE, ask = TRUE, ...)

Arguments

GUI

a logical indicating whether a graphics menu should be used if available. If TRUE, and on Windows, it will use winDialog, otherwise it will use menu.

ask

a logical indicating whether to ask the user for the number of minutes in which to perform the operation.

...

not in use

Value

The status code of system.

References

https://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu , https://www.howtogeek.com/howto/windows-vista/quick-tip-create-shutdown-restart-lock-icons-in-windows-vista/

See also

Examples

if (FALSE) { ## when your code is extremely time-consuming, # you may need this function; # e.g. you wish to go to sleep, # while keeping R running with a long computation... # complex graphics... and long long computation... # at last, os.manage() ## the next day you wake up, "thank you, R" :) }