I am trying to get my kable table to align in the center of my pdf from RMarkdown. Currently, it is aligning very left of my page and the caption is awkwardly floating in the center (pic at bottom).
I have tried the following code and still no luck:
version 1:
{r, eval=TRUE, echo=FALSE, fig.align='center'}
library(knitr)
library(kableExtra)
knitr::kable(latent_label_results, caption="Latent Model Parameter Estimates", row.names = FALSE, digits=2, align='lcc', booktabs = T, longtable = T) %>% kable_styling()
version 2:
kable(latent_label_results, caption="Latent Model Parameter Estimates",
row.names = FALSE, digits=2, booktabs = T, longtable = T) %>%
kable_styling(position="center")
It seems no matter what I do, I am left with this message,
In styling_latex_position_right(x, table_info, hold_position, table.envir) : Position = right is only supported for longtable in LaTeX. Setting back to center...
but it never centers. Any help would be greatly appreciated
kable(latent_label_results, "latex", row.names = FALSE, digits=2, longtable = T, booktabs = T) %>% kable_styling(position="center")