R knitr Markdown: Output Plots within For Loop

前端 未结 4 713
小蘑菇
小蘑菇 2020-12-02 11:55

I would like to create an automated knitr report that will produce histograms for each numeric field within my dataframe. My goal is to do this without having to specify the

4条回答
  •  广开言路
    2020-12-02 12:57

    As an addition to Hugo's excellent answer, I believe that in 2016 you need to include a print command as well:

    ```{r run-numeric-md, include=FALSE}
    out = NULL
    for (i in c(1:num_vars)) {
      out = c(out, knit_child('da-numeric.Rmd'))
    }
    
    `r paste(out, collapse = '\n')`
    ```
    

提交回复
热议问题