-1

I'm trying to build a table either using pandoc.table or kable and have problems getting them to print all 10 rows in my table, atm they both only prints the first six. While I moved to write the table manually, which works, it would be nice to know what's wrong with my code. I haven't seen anything to suggest that 6 rows are the limit, so my code should be workning? Anyone know why it doesn't? If I subset the dt I can print the last 4 as well so maybe 6 rows are a limit. Code below:

library("data.table")
library("knitr")
library("pander")

count.mark <- 35

dt.tbl1 <- data.table(Var = c("Geo", "A", "A",
                              "Cust", "A", 
                              "Ins", "A",
                              "Vei", "A",
                              "Brand"),
                      RangeR = c("A1", "S1", "T1",
                                 "Com", "Pri", 
                                 "T", "B",
                                 "Pa", "Pe",
                                 paste("A1 - A99 (",
                                       count.mark, ")", sep="")
                                 )
                      )
pandoc.table(head(dt.tbl1), justify = c("left", "centre"))
kable(head(dt.tbl1), justify = c("left", "centre"))
ErrantBard
  • 1,421
  • 1
  • 21
  • 40

1 Answers1

2

That's because you're using head(dt.tbl1), which by default shows the first six rows. You should just do, e.g.

pandoc.table(dt.tbl1, justify = c("left", "centre"))
Weihuang Wong
  • 12,868
  • 2
  • 27
  • 48