How do I reset all options() arguments to their de

2019-02-16 16:52发布

This question already has an answer here:

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.

标签: r settings
2条回答
狗以群分
2楼-- · 2019-02-16 16:54

I never tried it myself, but the settings package seems to provide a possibility to restore the default values without previously storing them:

library(settings)
reset(options)
查看更多
甜甜的少女心
3楼-- · 2019-02-16 16:56

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)

查看更多
登录 后发表回答