Exploring Facebook Birthdays List
How many people share my birthday?
my_birth_day <- (as.Date("2014-04-08"))
A<- better_birth_day[better_birth_day==my_birth_day]
length(A)
## [1] 6
Which month contains the most number of birthdays?
# seperate the year, mounth and day in to different columns.
df1<-data.frame(better_birth_day)
df<- separate(df1, better_birth_day,c("year", "month", "day"), sep = "-")
# create a table that indicate the number of birthdays in each mounth and find the max
monthTable <- table(df$month)
names(monthTable) <- month.name
monthTable[which(monthTable == max(monthTable))]
## March
## 98
How many birthdays are in each month?
# display the table
monthTable
## January February March April May June July
## 89 79 98 81 72 93 86
## August September October November December
## 91 96 89 87 72
Which day of the year has the most number of birthdays?
dateTable <- table(df1$better_birth_day)
dateTable[which(dateTable ==max(dateTable) )]
##
## 2014-02-06 2014-05-22 2014-07-16
## 8 8 8
Do you have at least 365 friends that have birthdays on everyday
of the year?
bt <- table (df1$better_birth_day)
length(names(bt))
## [1] 348