
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to deactivate scientific notation of numbers in R?
We can use options(scipen=999) to do this.
Example
> x <-c(253,254,36,874,351,651,245,274,19,1095) > t.test(x,mu=2000)
One Sample t-test
data: x t = -14.212, df = 9, p-value = 1.801e-07 alternative hypothesis: true mean is not equal to 2000
95 percent confidence interval −
151.3501 659.0499
sample estimates −
mean of x 405.2
Here p-value is in scientific notation. Now we can deactivate it as follows −
> options(scipen=999) > t.test(x,mu=2000)
One Sample t-test
data: x t = -14.212, df = 9, p-value = 0.0000001801 alternative hypothesis: true mean is not equal to 2000
95 percent confidence interval −
151.3501 659.0499
sample estimates −
mean of x 405.2
If we want to activate scientific notation again then it be done as shown below −
> options(scipen=0) > t.test(x,mu=2000)
One Sample t-test
data: x t = -14.212, df = 9, p-value = 1.801e-07 alternative hypothesis: true mean is not equal to 2000
95 percent confidence interval −
151.3501 659.0499
sample estimates −
mean of x 405.2
Advertisements