Regression tables in Markdown format (for flexible use in R Markdown v2)

后端 未结 6 1523
感动是毒
感动是毒 2020-12-13 00:49

The new version of R Markdown is based on pandoc, so you can easyly change the output format.

My Problem is to get markdown formated tables from e.g. regression mode

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 01:50

    Here what I did some hours ago:

    1. Some data:

      ```{r}
      lm1 <- lm(qsec ~ hp, mtcars)
      lm2 <- lm(qsec ~ wt, mtcars)
      ```
      
    2. We use the package sjPlot

      ```{r}
      library(sjPlot)
      tab_model(lm1,lm2, file="output.html")# You have to save the table in html format.
      ```
      

      The next part needs to be outside the chunk in markdown:

    htmltools::includeHTML("output.html")

提交回复
热议问题