shutdown: Shut down the operating system with the command 'shutdown'

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/shutdown.R

Description

There is a command shutdown in both Windows and Linux, and this function uses it to shut down a computer.

Usage

1
shutdown(wait = 0)

Arguments

wait

time to wait before shutting down (in seconds); passed to Sys.sleep

Details

After the time wait has passed, R will execute shutdown -s -t 0 (for Windows) or shutdown -h now to shut down the computer.

Value

The status code of system.

Author(s)

Yihui Xie <http://yihui.name>

See Also

system, Sys.sleep

Examples

1
2
3
4
5
6
7
if (interactive()) {
    # when your code is extremely time-consuming, you may need this function; e.g.
    # you go to sleep, and R is running long computation... complex graphics... and
    # long long computation... at last,
    shutdown()
    # the next day you wake up, 'thank you, R' :)
}

yihui/fun documentation built on Dec. 14, 2018, 6:22 p.m.