Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

r - How do I reset all options() arguments to their default values?

As noted in the title, I'm trying to understand how to reset all arguments in options() to their default settings. I searched online and in the ?options help file and am failing to locate an answer.

I expect the answer is readily available, and I'm simply struggling to find it.

Thanks.

Edit: While I agree How to set R to default options? is the same question, I'm failing to see in its selected answer the clear/explicit solution I requested: how to reset options() to its defaults. The selected answer in that thread clearly explains how to save options() settings and load them later.

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

If you restart your R session, it will reset the options to the default values. Options are saved in a list, and calling options() will show that list.

You can save the default options after restarting R:

backup_options <- options()

You can make any changes you need, and then to revert to the default options:

options(backup_options)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...