Warning message when qplot function is used in R


#1

Hello,
I’m doing data exploration in the pseudo facebook dataset from Udacity(Exploratory data analysis course). When I run this following piece of code:
qplot(x = friend_count, data = fb)+
+ scale_x_continuous(limits = c(0,1000))
why do I get the following warning message?:
stat_bin() using bins = 30. Pick better value with binwidth.
Warning message:
Removed 2951 rows containing non-finite values (stat_bin).
Regards


#2

Hi @B.Rabbit,

You haven’t defined the binwidth and because of that R has automatically taken the binwidth to be equal to 30(default). Also, since you have constrained the friend count to remain between 0 and 1000, the rows with a friend count greater than 1000 are removed from the data while making the histogram.