Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

r - Shutdown Windows after simulation

I want R to shutdown my computer after my (extensive) simulation and saving results, is this possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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"))
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...