]> git.vanrenterghem.biz Git - www2.vanrenterghem.biz.git/blobdiff - posts/using_R_to_automate_reports.org
Gebruik source folder.
[www2.vanrenterghem.biz.git] / posts / using_R_to_automate_reports.org
diff --git a/posts/using_R_to_automate_reports.org b/posts/using_R_to_automate_reports.org
deleted file mode 100644 (file)
index 2f204de..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#+date: 2016-10-10 21:48:11 +0800
-#+title: Using R to automate reports
-#+filetags: R code automation
-
-A lot of information on [[https://cran.r-project.org/web/packages/knitr/index.html][knitr]] is
-centered around using it for reproducible research. I've found it to be
-a nice way to make abstraction of mundane reporting though. It is as
-easy as performing the necessary data extraction and manipulation in an
-R script, including the creation of tables and graphs.
-
-To develop the report template, simply =source= the R script within an
-Rmd one, per the example template below:
-
-#+BEGIN_SRC R
-:PROPERTIES:
-:CUSTOM_ID: format-r
-:END:
-title: "My report" date: "=r Sys.time()=" output: pdf_document ---
-
-={r setup, include=FALSE} library(knitr) knitr::opts_chunk$set(echo = TRUE) source('my-report.R')=
-
-Include some text about your report.
-
-##Add a title.
-
-Some further text.
-
-={r, echo=FALSE} plot(my-plot-object) kable(my-df-or-table)=
-#+END_SRC
-
-When you are ready to create the report, the convenience of
-[[https://cran.r-project.org/web/packages/rmarkdown/][RMarkdown]] is
-hard to beat:
-
-#+BEGIN_SRC bash 
-R -e "rmarkdown::render('_{/my-report.Rmd',output_file='}/my-report.pdf')"
-#+END_SRC
-
-Thanks to the YAML header at the start of the report template,
-information like the report's title and target output format don't need
-to be mentioned. This command can easily be scripted a bit further to
-include a date-time stamp in the output filename for instance, and
-scheduled using =cron=.