pander icon indicating copy to clipboard operation
pander copied to clipboard

Data frame with non sequential row.names

Open renejuan opened this issue 8 years ago • 1 comments

Not sure if this is a bug but maybe is worth reporting as it may have unintended consequences.

mdf <- data.frame(a=c(1,2,3),b=letters[1:3])
pander(mdf)

# However if mdf row.names is non sequential then the row.names are printed
attributes(mdf)$row.names <- as.integer(c(1,5,8))
pander(mdf)

renejuan avatar Jun 29 '16 20:06 renejuan

Yeah, it's on purpose: https://github.com/Rapporter/pander/blob/2c1b47990bff538f1f1e2e7d8fa35bc5cada5940/R/pandoc.R#L1118

But we should indeed document it somewhere, good point!

daroczig avatar Sep 06 '16 17:09 daroczig