Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable scientific notation?

I have a dataframe with a column of p-values and I want to make a selection on these 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 really fine if I use it in R. But if I run it in another application (galaxy), the numbers which don't have e-01 e.g. 4.835312e-04 are not thrown out.

Is there another way to notate p-values, like 0.0004835312 instead of 4.835312e-04?

like image 697
Samantha Avatar asked Mar 18 '11 12:03

Samantha


People also ask

How do I get rid of E+ in R?

You can disable scientific notation in the entire R session by using the scipen option. Global options of your R workspace. Use options(scipen = n) to display numbers in scientific format or fixed. Positive values bias towards fixed and negative towards scientific notation.

How do I get rid of E+ in Excel?

Unfortunately excel does not allow you to turn this functionality off by default. However if you select your data, right click, and click "Format cells..." and choose Number you can stop excel from changing your data to scientific notation.


2 Answers

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

options(scipen=999) 
like image 195
Sacha Epskamp Avatar answered Sep 21 '22 05:09

Sacha Epskamp


format(99999999,scientific = FALSE) 

gives

99999999 
like image 26
Peter Avatar answered Sep 25 '22 05:09

Peter