gpt4 book ai didi

r - 如何防止R中的科学记数法?

转载 作者:行者123 更新时间:2023-12-03 06:30:54 25 4
gpt4 key购买 nike

我的图以 e 表示法的形式显示 y 轴上的值。我应该使用哪个命令来获取数字形式的值。文件中使用的值是数字形式吗?谢谢

最佳答案

要在整个 R session 中设置科学计数法的使用,您可以使用 scipen 选项。来自文档(?选项):

‘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.

所以本质上这个值决定了科学计数法被触发的可能性。因此,为了防止使用科学记数法,只需使用一个较大的正值,例如 999:

options(scipen=999)

关于r - 如何防止R中的科学记数法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25946047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com