{"action":"created","issue":{"url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/67","repository_url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook","labels_url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/67/comments","events_url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/67/events","html_url":"https://github.com/dr-harper/rmarkdown-cookbook/issues/67","id":367567153,"node_id":"MDU6SXNzdWUzNjc1NjcxNTM=","number":67,"title":"How to build Rmarkdown content dynamically","user":{"login":"cderv","id":6791940,"node_id":"MDQ6VXNlcjY3OTE5NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6791940?v=4","gravatar_id":"","url":"https://api.github.com/users/cderv","html_url":"https://github.com/cderv","followers_url":"https://api.github.com/users/cderv/followers","following_url":"https://api.github.com/users/cderv/following{/other_user}","gists_url":"https://api.github.com/users/cderv/gists{/gist_id}","starred_url":"https://api.github.com/users/cderv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cderv/subscriptions","organizations_url":"https://api.github.com/users/cderv/orgs","repos_url":"https://api.github.com/users/cderv/repos","events_url":"https://api.github.com/users/cderv/events{/privacy}","received_events_url":"https://api.github.com/users/cderv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-07T15:52:48Z","updated_at":"2018-10-31T18:42:29Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Parametrized reports are well known but there also other way to programatically create content on the document based on some results or other variables. \r\n\r\n## `knit_expand`\r\n\r\nknitr 📦 include a templating mechanism with `knitr_expand` function that works on a file or a text. See help file and [vignette](https://cran.r-project.org/web/packages/knitr/vignettes/knit_expand.html)\r\n\r\n## knit child\r\n\r\nThis is also kind of related to #14.\r\n\r\n## generate html or markdown and use `results='asis'`\r\n\r\n``````r\r\n```{r one-table-by-species, results='asis'}\r\nfor (i in unique(iris$Species)) {\r\n  cat(\"##\", i, \"\\n\")\r\n  cat(knitr::kable(head(iris[iris$Species == i, ,drop = FALSE]), format = \"html\", row.names = FALSE))\r\n  cat(\"\\n\")\r\n}\r\n```\r\n``````\r\n\r\n## External 📦 \r\n\r\n* [pander](http://rapporter.github.io/pander/#brew-to-pandoc) with _brew to pandoc_\r\n* [whisker](https://github.com/edwindj/whisker) templating framework\r\n* [glue](http://glue.tidyverse.org/) instead of `knitr_expand`\r\n\r\n## Related SO question\r\n\r\n- [ ] https://stackoverflow.com/questions/21729415/generate-dynamic-r-markdown-blocks\r\n- [ ] https://stackoverflow.com/questions/51158486/create-sections-through-a-loop-with-knitr/"},"comment":{"url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/comments/434802449","html_url":"https://github.com/dr-harper/rmarkdown-cookbook/issues/67#issuecomment-434802449","issue_url":"https://api.github.com/repos/dr-harper/rmarkdown-cookbook/issues/67","id":434802449,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDgwMjQ0OQ==","user":{"login":"dr-harper","id":20046224,"node_id":"MDQ6VXNlcjIwMDQ2MjI0","avatar_url":"https://avatars2.githubusercontent.com/u/20046224?v=4","gravatar_id":"","url":"https://api.github.com/users/dr-harper","html_url":"https://github.com/dr-harper","followers_url":"https://api.github.com/users/dr-harper/followers","following_url":"https://api.github.com/users/dr-harper/following{/other_user}","gists_url":"https://api.github.com/users/dr-harper/gists{/gist_id}","starred_url":"https://api.github.com/users/dr-harper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dr-harper/subscriptions","organizations_url":"https://api.github.com/users/dr-harper/orgs","repos_url":"https://api.github.com/users/dr-harper/repos","events_url":"https://api.github.com/users/dr-harper/events{/privacy}","received_events_url":"https://api.github.com/users/dr-harper/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T18:42:29Z","updated_at":"2018-10-31T18:42:29Z","author_association":"OWNER","body":"Related to this, this is the first time I have had to use `knit_expand`: https://stackoverflow.com/questions/53084808/how-to-insert-page-break-among-subfigures-inside-a-code-chunk-with-knitr#53084808\r\n\r\n\r\nP.S. sorry for the slight gap in work over the last couple of weeks. Had two journal articles back from peer review at the exact same time, so been occupied sorting those out."}}
{"actor":{"display_login":"dr-harper"}}