I am trying to get a simple table to a word list using Kable in a Rstudio markdown. With MSword i get this example:
I am trying to get this with Rstudio/Markdown in differents ways, but only get this:
library(kableExtra)
table= data.frame(words=c("uno", "dos", "tres", "cuatro", "cinco"))
kable(table)
table2= as.vector(table)
kable(table2)
table3=c("uno", "dos", "tres", "cuatro", "cinco")
kable(table3)
CodePudding user response:
You can try this:
```{r, echo = FALSE}
library(kableExtra)
library(data.table)
table3 <- data.frame("uno, dos, tres, cuatro, cinco")
table_t3 <- transpose(table3)
colnames(table_t3) <- NULL
kable(table_t3, format = "latex", align ="|c|", booktabs = T) %>%
kable_styling(latex_options =c("striped", "hold_position"))
```