R code from Personality and the collective: bold homing pigeons occupy higher leadership ranks in flocks

R code used in analysis