Hello,
I am trying to convert my results table into PDF, but I am not be able to get the results as I want it to. As an example I am using the datasets iris. Here is the code in R Markdown:
---
title: "Untitled"
date: "06/11/2020"
output: pdf_document
---
```{r results = "asis", echo = FALSE}
library(knitr)
lapply(iris[-c(5)],function(x){
result<-summary(lm(x~Species,data=iris))$coefficients
ls <- list(table1=result,table2=result)
for(x in seq_along(ls)){
print(
kable(ls[[x]],caption=names(ls)[x])
)
}
})
The results create a table with each of their caption, but it is not seperated with the name of the Species. Here is the pdf results:
test.pdf (73.6 KB)
Anyone could help me? Thank you!