Publications by Code R
Using ecmwfr to measure global warming
For my research I needed to download gridded weather data from ERA-Interim, which is a big dataset generated by the ECMWF. Getting long term data through their website is very time consuming and requires a lot of clicks. Thankfuly, I came accross the nifty ecmwfr R package that allowed me to do it with ease. One of the great things about open sou...
4325 sym R (4258 sym/11 pcs) 10 img
Using ecmwfr to measure global warming
For my research I needed to download gridded weather data from ERA-Interim, which is a big dataset generated by the ECMWF. Getting long term data through their website is very time consuming and requires a lot of clicks. Thankfuly, I came accross the nifty ecmwfr R package that allowed me to do it with ease. One of the great things about open sou...
4325 sym R (4258 sym/11 pcs) 10 img
Why I love data.table
I’ve been an R user for a few years now and the data.table package has been my staple package for most of it. In this post I wanted to talk about why almost every script and RMarkdown report I write start with: library(data.table) My memory issues I started working on my licenciate thesis (the argentinian equivalent to a Masters Degree) around...
6450 sym R (2825 sym/10 pcs) 2 img
Why I love data.table
I’ve been an R user for a few years now and the data.table package has been my staple package for most of it. In this post I wanted to talk about why almost every script and RMarkdown report I write start with: library(data.table) My memory issues I started working on my licenciate thesis (the argentinian equivalent to a Masters Degree) around...
6447 sym R (2825 sym/10 pcs) 2 img
Rammstein vs. Lacrimosa
Some time ago, someone I follow on twitter posted about having to buy a whole book with rules to tease out grammatical gender in German. Further down the replies, someone reminisced about trying (and failing) to learn German just by listening to Rammstein’s lyrics. I studied about drei Jahre of German at the same time I started listening to Ram...
8232 sym R (4308 sym/11 pcs) 10 img 1 tbl
Rammstein vs. Lacrimosa
Some time ago, someone I follow on twitter posted about having to buy a whole book with rules to tease out grammatical gender in German. Further down the replies, someone reminisced about trying (and failing) to learn German just by listening to Rammstein’s lyrics. I studied about drei Jahre of German at the same time I started listening to Ram...
8232 sym R (4308 sym/11 pcs) 10 img 1 tbl
Star Trek ratings on IMDB
My girlfriend and I are watching Star Trek: The Next Generation (TNG). The first season it’s pretty lame, but it gets better further down the line. That piqued my curiosity – is that impression shared by the rest of The Internets? So I decided to download the rating of every TNG episode from IDMB. I quickly realised that IMDB provides much mo...
8982 sym R (8772 sym/18 pcs) 14 img 1 tbl
The new R pipe
R 4.1.0 is out! And if version 4.0.0 made history with the revolutionary change of stringAsFactors = FALSE, the big splashing news in this next version is the implementation of a native pipe. The new pipe The “pipe” is one of the most distinctive qualities of tidyverse/dplyr code. I’m sure you’ve used or seen something like this: library...
6156 sym R (1582 sym/12 pcs)
Make error messages your own
The stop() function allows you to terminate the execution of a function if there is a fatal problem. For example, imagine this code that calculates the square root of a number but only if the input number is positive. real_root <- function(x) { if (x < 0) { stop("'x' cannot be negative.") } sqrt(x) } real_root(2) ## [1] 1.414...
2466 sym R (1097 sym/11 pcs)
Setting up a transparent reproducible R environment with Docker + renv
For my PhD I’m currently writing a paper using rmarkdown. Since I care about reproducibility, I’m using renv to register the versions of the R packages I use and to manage a local library that doesn’t affect the rest of my system. With that, anyone who wants to reproduce my work could download all the code, run renv::restore() and have an R...
6929 sym R (1653 sym/12 pcs) 2 img