Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R stat.desc()中的描述性统计数据采用科学符号形式_R_Scientific Notation - Fatal编程技术网

R stat.desc()中的描述性统计数据采用科学符号形式

R stat.desc()中的描述性统计数据采用科学符号形式,r,scientific-notation,R,Scientific Notation,假设我有一个数据帧“示例”,由一组随机整数组成 example <- data.frame(Column1 = floor(runif(7, min = 1000, max = 7000)), column2 = floor(runif(7, min = 12000, max = 70000))) 但描述性统计的输出是科学符号形式。我知道我能做到: format(stat.desc(example), scientific = FALSE)

假设我有一个数据帧“示例”,由一组随机整数组成

example <- data.frame(Column1 = floor(runif(7, min = 1000, max = 7000)), 
                      column2 = floor(runif(7, min = 12000, max = 70000)))
但描述性统计的输出是科学符号形式。我知道我能做到:

format(stat.desc(example), scientific = FALSE)

它会将其转换为非科学记数法,但为什么科学记数法是默认的输出模式呢?

它是这样创建的。但是,您可以设置以下选项:

options(scipen=100)
options(digits=3)
stat.desc(example)

这将生成您喜欢的输出,而不需要在之后转换为小数。我已经包括了舍入,因为如果没有舍入选项,它可能是6-7位数字。这将给你3位小数,没有科学符号

您需要指出
stat.desc
的来源。是的,对不起,这就是stat.desc的来源。这里有一个参考:BethanyP,你太棒了。非常感谢你。我没有足够的声望来评价你,但谢谢你
options(scipen=100)
options(digits=3)
stat.desc(example)