How can I make a pander discard trailing zeros when I simultaneously tell it to round values above their corresponding number of significant digits?
In the following reproducible example, I am trying to round a column of p-values for two hypothetical variables (male and female).
require(pander)
Gender <- c("Female", "Male")
p <- c(4.342e-06, 1.325e-05)
table <- data.frame(Gender, p)
panderOptions('round', 4)
panderOptions('keep.trailing.zeros', TRUE)
pandoc.table(table,
round = panderOptions("round"),
keep.trailing.zeros = panderOptions("keep.trailing.zeros"))
However i get
Gender p
Female 0
Male 0
But I want to get
Gender p
Female 0.0000
Male 0.0000
How can i do this?
** PS: I know this question , but it does not solve my problem. *
: , , , , , , - . NicE ( rawr ), , , .