Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in R Programming by (7.3k points)
edited by

I have a data frame 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 fine if I use it in R. But if I run it in another application (galaxy), the numbers that 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?

1 Answer

0 votes
edited by

To prevent scientific notation in an R session, you can use the scipen option from the options function as follows:


Note: This will disable the scientific notation in the global setting.

To disable scientific notation for a particular function, use the following:

format(functionResult, scientific=FALSE)

Browse Categories