Site icon R-bloggers

Generating an academic CV with R and YAML

[This article was first published on James Keirstead » Rstats, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Follow
Email

For the past couple years, I’ve been using Kieran Healy’s lovely template for my academic CV. Kieran’s code is a customised *.tex file which, of course, has the virtue of simplicity. All a person needs to do is update it with glorious achievements from time to time and re-compile; this is exactly what I’ve been doing since adopting the template in 2011.

But since that time, I’ve had a little niggle in the back of my mind, a concern that despite the elegance of the typography, the underlying software design left something to be desired. If you are manually updating a TeX file with your vita information, then how do you deal with these use cases?

All of this suggests that there should be a separation of content and style, just like a webpage. A full PDF is only one way to display CV data and I wanted something that would be easy to maintain, yet would allow me to generate new output formats quickly if necessary.

So I have developed a system for storing CV data, including academic publications, and generating custom outputs based on a configuration file. Although there are several moving parts, the basic design is simple.

If you want to try to manage your CV with the same approach, then all of the code is available on my Github page. I’m aware that this isn’t really a standalone R package because it includes my specific data but I think that that’s useful at this point in the software’s development, because you can see how everything fits together. I could of course have made up some dummy people, and if I was to submit the package to CRAN, then I probably would. But at the moment, that’s a poor use of time and the relevant personal data is in the public domain anyway.

A final point: why R? The short answer is that it’s what I know best and so I could whip up this prototype relatively quickly. But when you look through the code, you’ll see that it takes advantage of R’s list manipulation functions. This makes it dead easy to parse YAML (with the yaml library) and then process the resulting lists to give the desired output. The paste(..., collapse) function was very handy too, for example, in formatting all of the journals that I’ve done reviews for. I’m sure others could do something similar in Python or whatever other language, but in this case, R just worked.

To leave a comment for the author, please follow the link and comment on their blog: James Keirstead » Rstats.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.