How can I set a specific decimal value for the output of pbinom()?

Viewed 27

I have a single line of code below and the output displayed as below too. But how do I actually set the output to be 4 decimal places?

2*(1-pbinom(175, 240, 0.5))

output: 2.853273e-13

1 Answers

You can set options(digits = ...)

> options(digits = 5)

> 2 * (1 - pbinom(175, 240, 0.5))
[1] 2.8533e-13
Related