4 ms·
> Part of the problem is that as datasets get bigger, it's rarely sustainable to put a lot of care into each and every version of a plot, but automating creatio
by jfim 7y ago
> Part of the problem is that as datasets get bigger, it's rarely sustainable to put a lot of care into each and every version of a plot, but automating creation of figures is really hard.
That's actually a good reason to learn R and the ggplot2 package. Whenever I write a paper, what I do is that I make a quick shell script that invokes Rscript, with a simple R program that takes a CSV file and outputs a PDF file of the plot, which can be automatically loaded in LaTeX.
Whenever the data changes, it's just a matter of updating the CSV file and running the script that rebuilds the figures and the LaTeX document. As an added bonus, it makes keeping the data with the paper easy, since they're part of the same source control repository.
- airstrike 7y agoIs there a reason you don't use RMarkdown in RStudio? It's built precisely for this use case
- jfim 7y agoMostly because I wrote those scripts many years ago and I've been reusing them since. I'll look into RMarkdown for the next paper, thanks!
- samch93 7y agoI can totally recommend knitr by the amazing yihui xie (https://yihui.org/knitr/ https://yihui.org/knitr/ ) for this use case. It allows you to write R code chunks directly in your latex code and the output of the code (tables, plots) is then directly inserted in your pdf after compiling. Together with git and docker this gives a fully reproducible workflow!