decimal point in r

Published by onesixx on

options(digits=16, scipen=666, max.print=666, digits.secs=9)

# 결과를 문자취급(연산안됨)
format(6)
"6"
format(6) %>% as.numeric
6

# 총자릿수 
format(123.123456789, digits=9)
"123.123457"
format(123.123456789, digits=6)
"123.123"
options(digits=4) # 숫자변환시  Option에 영향
format(123.123456789, digits=6) %>% as.numeric()
123.1

# 소수점 이하 최소 자릿수
format(123.123456789, nsmall=6)  
"123.123457"

# scientific notation.
format(6, scientific = TRUE)
"6e+00"
Categories: R Basic

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x