I want to create multiple tabs in my R/beamer presentation. I have a code that is working :
list_variables <- names(starwars)[sapply(starwars,is.character)]for (var in list_variables) { var_in <- starwars[[var]] table <- as.data.frame(table(var_in,exclude=NULL)) print(kable(table, booktabs = TRUE, caption = paste("Une Table",var)))}
but as soon as I want to add "kable_styling" option (for example to precise the font_size) to my "kable" command, my Rmd/beamer don't compile anymore. And surprisingly, when I write the same code outside the for-loop, I can add "kable_styling" options. Do you have any advice ?
I tried to compile it outside of the for-loop and it worked :
var_in <- starwars$hair_colortable <- as.data.frame(table(var_in,exclude=NULL))kable(table,"latex",caption = paste("Une Table"),booktabs=T) %>% kableExtra::kable_styling(font_size = 6)
How can I implement it in my for-loop ? (to be able to compute it with all the variables in my list)