Pau*_*tra 57
要在整个R会话中设置科学记数法的使用,您可以使用该scipen选项.从文档(?options):
‘scipen’: integer. A penalty to be applied when deciding to print
numeric values in fixed or exponential notation. Positive
values bias towards fixed and negative towards scientific
notation: fixed notation will be preferred unless it is more
than ‘scipen’ digits wider.
Run Code Online (Sandbox Code Playgroud)
所以从本质上讲,这个值决定了触发科学记数法的可能性.因此,为了防止科学记数法,只需使用大的正值,如999:
options(scipen=999)
Run Code Online (Sandbox Code Playgroud)
rns*_*nso 50
试试'格式'功能:
> xx = 100000000000
> xx
[1] 1e+11
> format(xx, scientific=F)
[1] "100000000000"
Run Code Online (Sandbox Code Playgroud)