I've been knitting to a Word Document from an .rmd file using papaja. I have found that when there is a blank cell in a row, that particular row's height is disproportionately taller than rows without. I've set up my .rmd using the provided template from papaja.
This table produces a normal looking table in a word document:
data <- mtcars
table_1 <- data %>%
group_by(vs) %>%
summarise("Mean cyl" = mean(cyl), "Mean wt" = mean(wt))
apa_table(table_1, caption = "Table 1 with no blank space")
However, if I remove one of the column headers and replace it with just an empty character string, like this:
table_2 <- table_1
colnames(table_2) <- c("","Mean cyl","Mean wt")
apa_table(table_2, caption = "Table 2 with a blank space")
The row that the blank space is in is much taller than the table without the blank space. I've played around with it and it also happens when I just use kable()
to knit a table, so it might have something to do with kable. I'll attach a screenshot of what the two tables look like. Oh, bonus question, is there any way to put "Table X:" and the table caption on the same line? Tables rendered in a word doc