also posted as an issue on github
After using group_by
, cannot output table with pandoc correctly with the digits=
or round=
parameters.
Take the group_by
out of the chain and pandoc displays the table just fine. Add the group_by
in and the number of decimal places of the floating point numbers is way to big to display.
# test dataframe
dat <- data.frame(matrix(rnorm(10 * 10), 10))
group <- rbinom(10,20,.1)
df1 <- cbind(group, dat)
library(pander)
pander(df1, digits = 2, keep.line.breaks = TRUE, split.table = Inf,
caption = "Not Grouped, correct format")
library(dplyr)
df2 <- df1 %>%
group_by(group)
pander(df2, digits = 2, keep.line.breaks = TRUE, split.table = Inf,
caption = "Grouped, incorrect format")
Is there a way around this?