Time to make the house more customized and comfortable.

I moved my personal website to :


I know this will cause some pain to my habitual readers and I do apologize for that. Nevertheless, I made this tough decision after long reasoning: moving to a new website, completely developed with R and Hugo, in the end, will result in a great gain for my readers.

Within this website, I will have the freedom to mix R code, Html and whatever form of programming, crafting relevant and high-quality content.

See you on andreacirillo.com then 🙂




Why are you being so silent?

Why are you being so silent?

It has being nearly half an year since the last post about workflower was out, why did I stay so silent for that long?

I have three major updates to explain the silence:

  • 📚 Good guys at Packt publishing asked me to write one more book about R and data mining, I suppose this is because the first one was well received
  •  📦 I spend my spare time working on updateR so to get it ready to go on CRAN. We make it so shining and bright that it got noticed by our beloved Tal Galili and we are now working togheter to merge it into his great package installR
  • 👶🏻 We at home are waiting the fourth kid 

More is coming about the first two points later on this blog. If you are looking for more news on the third point you can write to me privately 🙂. 

📊 streamline your analyses linking R to sas and more: the workfloweR experiment 🖥

📊 streamline your analyses linking R to sas and more: the workfloweR experiment 🖥
we all know R is the first choice for statistical analysis and data visualisation, but what about big data munging? tidyverse (or we’d better say hadleyverse 😏) has been doing a lot in this field, nevertheless it is often the case this kind of activities being handled from some other coding language. Moreover, sometimes you get as an input pieces of analyses performed with other kind of languages or, what is worst, piece of databases packed in proprietary format (like .dta .xpt and other). So let’s assume you are an R enthusiast like I am, and you do with R all of your work, reporting included, wouldn’t be great to have some nitty gritty way to merge together all these languages in a streamlined workflow?

Continue reading “📊 streamline your analyses linking R to sas and more: the workfloweR experiment 🖥”

ggplot2 themes examples

ggplot2 themes examples
this short post is exactly what it seems: a showcase of all ggplot2 themes available within the ggplot2 package. I was doing such a list for myself ( you know that feeling …”how would it look like with this theme? let’s try this one…”) and at the end I thought it could have be useful for my readers. At least this post will save you the time of trying all differents themes just to have a sense of how they look like.

Continue reading “ggplot2 themes examples”

Euro 2016 analytics: Who’s playing the toughest game?

Euro 2016 analytics: Who’s playing the toughest game?

I am really enjoying Uefa Euro 2016 Footbal Competition, even because our national team has done pretty well so far. That’s why after  browsing for a while statistics section of official EURO 2016 website I decided to do some analysis on the data they share ( as at the 21th of June).

Just to be clear from the beginning: we are not talking of anything too rigourus, but just about some interesting questions with related answers gathered mainly through data visualisation.

We can divide following analyses into two main parts: a first part were we analyse distribution of fouls and their incidence on matches outcome and a second part where ball possession in analysed, once again looking at relationship between this stat and matches outcome. Let’s start with fouls then.

which team committed the  greatest number of fouls?

Here we are with the first question. And here it is the answer:


Continue reading “Euro 2016 analytics: Who’s playing the toughest game?”

a Checklist for your weekly review (GTD methodology)

a Checklist for your weekly review (GTD methodology)

I was crafting this checklist for my personal use, and then I found myself thinking: why should’nt I share this useful handful of bullets with my readers? So here we are, find below an useful checklist for your weekly review. The checklist is derived directly from the official GTD book by our great friend David Allen. The greatest quality of the checklist is the minimalist approach: just what you really need to read is written within each point, so that you get through your review as quick as possible. Enjoy!

Weekly Review Checklist for GTD

  • look for sleeping actions within SMS, mail, backpack, notes and whatever. collect everything into your inbox.

  • look for previous and next weeks within your calendar, any sleeping action out there?

  • process your just-feeded inbox, get it empty!

  • check all actions you completed during past week and you didn’t checked off because you were, as usual, in a rush

  • look at your waiting for list: any one to followup?

  • look at your active projects: is there at least one next action in the proper list for each one of them?

  • look at your someday/maybe list: had come the time to embrace any parked project/action?

I personally use this checklist every Saturday morning and we can therefore give it for tested, nevertheless I am here to listen to every suggestion of improvement. You can download here below a PDF version of the checklist for your convenience.

download a free PDF version

Over 50 practical recipes for data analysis with R in one book

Over 50 practical recipes for data analysis with R in one book
Ah, writing a blog post! This is a pleasure I was forgetting, and you can guess it looking at last post date of publication: it was around january... you may be wondering: what have you done along this long time? Well, quite a lot indeed:
  • changed my job ( I am now working @ Intesa Sanpaolo Banking Group on Basel III statistical models)
  • became dad for the third time (and if you are guessing, it’s a boy!)
  • fixed some issues with the updateR package
  • and I wrote a book!
Hope this pretty long list will help you forgive me for my long silence. I am actually pretty proud of all of them, but let’s talk about the book now. I think it is an useful contribution to the R community. But first of all, the title:

RStudio for R Statistical Computing Cookbook

Continue reading “Over 50 practical recipes for data analysis with R in one book”

2015 in review (let me boast myself a bit :))

The WordPress.com stats helper monkeys prepared a 2015 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 8,800 times in 2015. If it were a concert at Sydney Opera House, it would take about 3 sold-out performances for that many people to see it.

Click here to see the complete report.

Rename a Data Frame Within a Function Passing an Argument

Rename a Data Frame Within a Function Passing an Argument

This is not actually a real post but rather a code snippet surrounded by text.

Nevertheless I think it is a quite useful one: have you ever found yourself writing a function where a data frame is created, wanting to name that data frame based on a custom argument passed to the function?

For instance, the output of your function is a really nice data frame name in a really trivial way, like “result”.

But your dream is to let the user (or some piece of code behind the function) specify the data frame name, passing it as an argument of your function.

To achieve that you need to look at assign function, which let’s you access the hash table of a given environment (pos argument) and change the value of a given variable.

Find below a working function which applies this idea:

rename_df  =  function(choosen_name){
data_set  =  data.frame(column_A = c(1,4,6,7,8),column_B = c(seq(1:5)))
title  =  choosen_name
assign(title,data_set,pos = ".GlobalEnv")

Have you found any other way to get here? I would love to here it!

p.s.: wondering why I chose that image? well, is Adam naming animals.. 🙂

UpdateR package: update R version with a function (on MAC OSX)

UpdateR package: update R version with a function (on MAC OSX)

THIS IS AN OUTDATED VERSION OF THE POST. YOU CAN FIND THE UPDATED AND MAINTAINED ONE AT  http://www.andreacirillo.com/2018/03/10/updater-package-update-r-version-with-a-function-on-mac-osx/

I personally really appreciate the InstallR package from Tal galilli, since it lets you install a great number of tools needed for working with R just running a function.

Among these functions one of my favourite is the updateR()* function which checks for new versions of R language and in case of positive response installs it on your machine.

The only issue with this function is that it works only on Windows Operating systems.

Continue reading “UpdateR package: update R version with a function (on MAC OSX)”