The options()
function in R is used to set and examine different global options that affects the way in which R determines and returns its results.
The options()
function takes the syntax below:
options(…)
The options()
function takes the parameter value, ...
, which represents any option that can be defined using name=value
.
Below, we have a list of some options that are used in base R:
Options | result |
add.smooth | TRUE |
check.bounds | FALSE |
continue | “+” |
digits | 7 |
echo | TRUE |
encoding | “native.enc” |
expressions | 5000 |
# implementing the options() function# setting the digits optionoptions(digits=10)print(10/7)# to set the console widthoptions(width=100)
digits
option to 10
using the options()
function.width
to 100
.