First, I'm not familiar with the Python language, so I'm going to focus on the R language.
For data manipulation with R and sql, you can take a look at the RSQLite
package that is particularly well done.
Considering that you manipulate data and graphs in R
and the report via LaTeX
, here are some options to perform analyzes, graphs and report automatically and reproducibly:
1. R and LaTeX integrated by makefile
make
is a way to automate processes that you would do by hand on your system. In your example, you would code a makefile script to first run the R / python script to do the analysis, then run the R script to create the graphs and save it to a folder and then run the LaTeX script to create the report using the outputs of the previous scripts.
Positive: complete flexibility for each step performed and good organization of each project script.
Negative: makefile is a bit difficult to create and is native to both linux and iOS systems. I do not know how it works in Windows.
2. R and LaTeX integrated by Sweave
Sweave
is a .Rnw
extension of knitr
that allows you to embed R code in LaTeX documents to generate a PDF file. In short, you write the report in laTex and for each analysis / chart, you enter the R code.
Positive: flexible and easy to use if you know LaTeX
Negative: I have the impression that there are very few users compared to Rmarkdown
, which makes it a bit more difficult to solve problems online.
3. R and LaTeX integrated by Rmarkdown
Rmarkdown
is an R package that allows you to embed R-code in markdown documents. It has practically the same approach as Sweave
, only more flexible because it allows exporting to various extensions (pdf, html, word ...).
Positive: More friendly and simple to learn if you do not know LaTeX. In addition to the cleanest syntax.
Negative: The formatting of the report is not as flexible as LaTeX, but the interesting thing is that you can incorporate LaTeX or html styles into the document.
In conclusion, I personally believe Rmarkdown
will be the easiest and fastest way to achieve your goals.