I have a column that has decimal numbers (more than 50,000 rows). but the numbers are expressed as a form like this -> 3.900163e-02 How can I change this number to 0.03900163 in R?
Asked
Active
Viewed 4,567 times
2
-
1You cannot. They are the same number. Perhaps you need either `?format` or `?options`. – IRTFM Jan 20 '14 at 06:22
-
3You can use `sprintf` or `formatC`. try `formatC(3.900163e-02, digits = 7)` – dickoa Jan 20 '14 at 06:22
-
@dickoa thank you so much! – Kangmin Jan 20 '14 at 06:27
1 Answers
3
As it was mentioned they are the same numbers, but if you want to print them in different format use format function:
x <- 0.000000000001
x
## [1] 1e-12
format(x, scientific=FALSE)
## [1] "0.000000000001"
bartektartanus
- 14,101
- 5
- 73
- 98