R: displaying scientific notation -


chocolate <- data.frame(   sabor =   c(5, 7, 3,     4, 2, 6,     5, 3, 6,     5, 6, 0,     7, 4, 0,     7, 7, 0,     6, 6, 0,     4, 6, 1,     6, 4, 0,     7, 7, 0,     2, 4, 0,     5, 7, 4,     7, 5, 0,     4, 5, 0,     6, 6, 3   ), tipo = factor(rep(c("a", "b", "c"), 15)), provador = factor(rep(1:15, rep(3, 15)))) tapply(chocolate$sabor, chocolate$tipo, mean) ajuste <- lm(chocolate$sabor ~ chocolate$tipo + chocolate$provador) summary(ajuste) anova(ajuste) a1 <- aov(chocolate$sabor ~ chocolate$tipo + chocolate$provador) posthoc <- tukeyhsd(x=a1, 'chocolate$tipo', conf.level=0.95)    tukey multiple comparisons of means     95% family-wise confidence level  fit: aov(formula = chocolate$sabor ~ chocolate$tipo + chocolate$provador)  $`chocolate$tipo`            diff       lwr       upr     p adj b-a -0.06666667 -1.803101  1.669768 0.9950379 c-a -3.80000000 -5.536435 -2.063565 0.0000260 c-b -3.73333333 -5.469768 -1.996899 0.0000337 

here sample code using tukeyhsd. output matrix, , want values displayed in scientific notation. i've tried using scipen , setting options(digits = 20) of values actual data still way small p adj values 0.00000000000000000000

how can values displayed in scientific notation?

you this:

format(posthoc, scientific = true) 

if want change number of digits, instance using 3, this:

format(posthoc, scientific = true, digits = 3) 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -