'apa_table() increase table width

How do I increase the width of an apa_table in R Markdown. I'm using the papaja package. I would like the width to be long enough to fit the table's title.

This is the code I'm using for my tables:

```{r '1996 - 1997 Count Matrix',echo=FALSE, message=FALSE, warning=FALSE, results="asis"}

apa_table(count_transition_matrix_9697,
      caption = "One-Period Short Ratings Transition Count Matrix, 1996 - 1997",
      align = c("c"),
      added_stub_head = "Period 1 Short Ratings",
      col_spanners = list(`Period 2 Short Ratings` = c(2,7)   
      ))
```

And the output looks like this:

enter image description here

I've tried including "fig.width" in the r chunk but that doesn't work. Any guidnace would be apreciated.



Solution 1:[1]

Very late to this party (still looking for a better solution myself) but I think you could now increase the table width manually by setting the width of the columns using the align argument:

apa_table(
.
.
align = c("m{5cm}", rep("m{2}", 6),
.
.
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Rao