Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 65 forks source link

Adding the numeric p-value to the output of class htest, #227

Closed s1lvester closed 9 years ago

s1lvester commented 9 years ago

whilst keeping the significance stars. Maybe one could change the number of digits in the round() function to global pander variable name but I didn't find that on the fly.

codecov-io commented 9 years ago

Current coverage is 78.00%

Merging #227 into master will increase coverage by +0.03% as of 7e84a25

Powered by Codecov. Updated on successful CI builds.

daroczig commented 9 years ago

Wow, this bug was introduced a while ago -- thanks a lot for the fix!

Can you replace that hardcoded 5 with panderOptions('round') for the consistency of the package and even wrapping that in format like we do in the p function and inside of the markdown tables? Also, why do we need the c function? I think it's safe to remove that around the paste call. Last Q: shouldn't we add the significance stars after the actual P value? E.g.:

res$'P value' <- paste(
    format(round(x$p.value, panderOptions('round')),
           trim         = TRUE,
           digits       = panderOptions("digits"),
           decimal.mark = panderOptions("decimal.mark")),
    add.significance.stars(x$p.value))
s1lvester commented 9 years ago

Your fix is even better. :-)

Am 21.09.2015 um 09:06 schrieb Gergely Daróczi notifications@github.com:

Wow, this bug was introduced a while ago -- thanks a lot for the fix!

Can you replace that hardcoded 5 with panderOptions('round') for the consistency of the package and even wrapping that in format like we do in the p function and inside of the markdown tables? Also, why do we need the c function? I think it's safe to remove that around the paste call. Last Q: shouldn't we add the significance stars after the actual P value? E.g.:

res$'P value' <- paste( format(round(x$p.value, panderOptions('round')), trim = TRUE, digits = panderOptions("digits"), decimal.mark = panderOptions("decimal.mark")), add.significance.stars(x$p.value)) — Reply to this email directly or view it on GitHub.

s1lvester commented 9 years ago

so the latest patch (4ead3f5) works fine for me. Although my results aren't that great, but that' another story...

3_tests

daroczig commented 9 years ago

Thanks for this. And good luck with the results :) One question about that: the stars seem to be in front of the P value. Is it intended? The currently merged code should render that after the numeric value.

s1lvester commented 9 years ago

No it wasn't inteded. I forgot to delete the caches and re-knit the html output... It's all good now :)