Publications by Econometrics and Free Software

Lesser known dplyr tricks

09.03.2017

In this blog post I share some lesser-known (at least I believe they are) tricks that use mainly functions from dplyr. Removing unneeded columns Did you know that you can use - in front of a column name to remove it from a data frame? mtcars %>% select(-disp) %>% head() ## mpg cyl hp drat wt qsec vs am gear car...

2101 sym R (8792 sym/10 pcs)

Lesser known purrr tricks

24.03.2017

purrr is a package that extends R’s functional programming capabilities. It brings a lot of new stuff to the table and in this post I show you some of the most useful (at least to me) functions included in purrr. Getting rid of loops with map() library(purrr) numbers <- list(11, 12, 13, 14) map_dbl(numbers, sqrt) ## [1] 3.316625 3.464102 3....

3506 sym R (3985 sym/13 pcs)

Lesser known purrr tricks

24.03.2017

purrr is a package that extends R’s functional programming capabilities. It brings a lot of new stuff to the table and in this post I show you some of the most useful (at least to me) functions included in purrr. Getting rid of loops with map() library(purrr) numbers <- list(11, 12, 13, 14) map_dbl(numbers, sqrt) ## [1] 3.316625 3.464102 3....

3508 sym R (3899 sym/13 pcs)

Lesser known purrr tricks

24.03.2017

purrr is package that extends R’s functional programming capabilities. It brings a lot of new stuff to the table and in this post I show you some of the most useful (at least to me) functions included in purrr. Getting rid of loops with map() library(purrr) numbers <- list(11, 12, 13, 14) map_dbl(numbers, sqrt) ## [1] 3.316625 3.464102 3.60...

3506 sym R (3896 sym/13 pcs)

Introducing brotools

27.03.2017

I’m happy to announce my first R package, called brotools. This is a package that contains functions that are specific to my needs but that you might find also useful. I blogged about some of these functions, so if you follow my blog you might already be familiar with some of them. It is not on CRAN and might very well never be. The code is hos...

851 sym R (51 sym/1 pcs)

Introducing brotools

27.03.2017

I’m happy to announce my first R package, called brotools. This is a package that contains functions that are specific to my needs but that you might find also useful. I blogged about some of these functions, so if you follow my blog you might already be familiar with some of them. It is not on CRAN and might very well never be. The code is hos...

851 sym R (51 sym/1 pcs)

Make ggplot2 purrr

28.03.2017

Update: I’ve included another way of saving a separate plot by group in this article, as pointed out by @monitus. Actually, this is the preferred solution; using dplyr::do() is deprecated, according to Hadley Wickham himself. I’ll be honest: the title is a bit misleading. I will not use purrr that much in this blog post. Actually, I will use ...

5088 sym R (2277 sym/12 pcs) 4 img

Make ggplot2 purrr

28.03.2017

I’ll be honest: the title is a bit misleading. I will not use purrr that much in this blog post. Actually, I will use one single purrr function, at the very end. I use dplyr much more. However Make ggplot2 purrr sounds better than Make ggplot dplyr or whatever the verb for dplyr would be. Also, this blog post was inspired by a stackoverflow que...

3728 sym R (1333 sym/10 pcs) 4 img

Lesser known dplyr 0.7* tricks

01.07.2017

This blog post is an update to an older one I wrote in March. In the post from March, dplyr was at version 0.50, but since then a major update introduced some changes that make some of the tips in that post obsolete. So here I revisit the blog post from March by using dplyr 0.70. Create new columns with mutate() and case_when() The basic things ...

4318 sym R (4127 sym/16 pcs)

Lesser known dplyr 0.7* tricks

01.07.2017

This blog post is an update to an older one I wrote in March. In the post from March, dplyr was at version 0.50, but since then a major update introduced some changes that make some of the tips in that post obsolete. So here I revisit the blog post from March by using dplyr 0.70. Create new columns with mutate() and case_when() The basic things ...

4318 sym R (4127 sym/16 pcs)