This was originally reported at http://forums.udacity.com/questions/100254695/problems-with-dplyr-040. It appears to be specific to v0.40.
First download the dataset from https://s3.amazonaws.com/udacity-hosted-downloads/ud651/pseudo_facebook.tsv
Then, create the dataset pf using pf <- read.delim('~/Downloads/pseudo_facebook.tsv'), changing the file location to be appropriate to your system.
The bug occurs by running
pf.age_and_gender <-
group_by(subset(pf, !is.na(gender)), age, gender)
pf.fc_by_age_gender <- summarise(pf.age_and_gender,
mean_friend_count = mean(friend_count),
median_friend_count = median(friend_count),
n =n ())
with error message Error: loss of precision when attempting to convert a numeric to an integer.