Yes, look at the function shutdown
in the package fun
.
The flags for system command shutdown
depends on your operating system, the function simply calls the appropriately flagged command.
fun::shutdown
function (wait = 0)
{
Sys.sleep(wait)
ifelse(.Platform$OS.type == "windows", shell("shutdown -s -t 0"),
system("shutdown -h now"))
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…