如何禁用R中的科学记数法? [英] How to disable scientific notation in R?

查看:215
本文介绍了如何禁用R中的科学记数法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的问题。我有一个数据帧与行p值,我想对这个p值进行选择。

 > pvalues_anova 
[1] 9.693919e-01 9.781728e-01 9.918415e-01 9.716883e-01 1.667183e-02
[6] 9.952762e-02 5.386854e-01 9.997699e-01 8.714044e- 01 7.211856e-01
[11] 9.536330e-01 9.239667e-01 9.645590e-01 9.478572e-01 6.243775e-01
[16] 5.608563e-01 1.371190e-04 9.601970e- 01 9.988648e-01 9.698365e-01
[21] 2.795891e-06 1.290176e-01 7.125751e-01 5.193604e-01 4.835312e-04

选择方式:

  anovatest < -  results [ -  which(结果$ pvalues_anova< 0.8),] 

如果我在R中使用它,但是,如果我运行在另一个应用程序(星系),数字与没有-01例如4.835312e-04-04不会被抛出。

所以,我的问题是,是否有另一种方式来表示p值。例如: 0.0004835312 代替 4.835312e-04



  options(h2_lin>解决方案 scipen = 999)


I have a simple question. I have a dataframe with a row p-values and I want to make a selection on this p-values.

> pvalues_anova
[1] 9.693919e-01 9.781728e-01 9.918415e-01 9.716883e-01 1.667183e-02
[6] 9.952762e-02 5.386854e-01 9.997699e-01 8.714044e-01 7.211856e-01
[11] 9.536330e-01 9.239667e-01 9.645590e-01 9.478572e-01 6.243775e-01
[16] 5.608563e-01 1.371190e-04 9.601970e-01 9.988648e-01 9.698365e-01
[21] 2.795891e-06 1.290176e-01 7.125751e-01 5.193604e-01 4.835312e-04

selection way:

anovatest<- results[ - which(results$pvalues_anova < 0.8) ,]

The function works realy fine if I use it in R. But if I run in another application(galaxy), the numbers with doesn't have -01 e.g. 4.835312e-04-04 are not thrown out.

So, my question is, is there another way to notate p-values. like: 0.0004835312 in stead of 4.835312e-04?

解决方案

You can effectively remove scientific notation in printing with this code:

options(scipen=999)

这篇关于如何禁用R中的科学记数法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆