Excellent Class by far! But I just have to point something that I think it was an error. At 26:01 his script to calculate the hour and minutes of the dep variable is: mutate(flights, hour = dep %/% 100, minute = dep %% 100) So... Isn't that wrong? Cause the dep is in minutes and to pass to hours is minutes/60, so the right script should be: mutate(flights, hour = dep %/% 60, minute = dep %% 60) I've not finished the class yet, so I don't know if he'll correct it later, but if someone could just feed back me later, I would be thankful!
Hello. I used the following piped formula but I think the last part is wrong. I essentially want to divide sum by number of instances BUT within each breakdown. I think it's taking the list of ALL instances because the resulting number is too small. How can I adjust? by.month % group_by(Months) %>% summarize(no = sum(total), yes = sum(BED.Contracts)/length(BED.Contracts))
wrt code snippet at 45:40 When i try the following piece of code.... flights %>% group_by(carrier, flight, dest)%>% tally(sort = TRUE)%>% filter(n == 365) ... i get an error saying -> Error in eval(expr, envir, enclos) : could not find function "desc" BUT, if i remove the "sort = TRUE" part in the tally command, it runs fine!!! What might be the reason??
Excellent Class by far! But I just have to point something that I think it was an error.
At 26:01 his script to calculate the hour and minutes of the dep variable is:
mutate(flights,
hour = dep %/% 100,
minute = dep %% 100)
So... Isn't that wrong? Cause the dep is in minutes and to pass to hours is minutes/60, so the right script should be:
mutate(flights,
hour = dep %/% 60,
minute = dep %% 60)
I've not finished the class yet, so I don't know if he'll correct it later, but if someone could just feed back me later, I would be thankful!
The Dropbox link is broken, from where can I download the datasets
hadley wickham is brilliant man
Hello. I used the following piped formula but I think the last part is wrong. I essentially want to divide sum by number of instances BUT within each breakdown. I think it's taking the list of ALL instances because the resulting number is too small. How can I adjust?
by.month %
group_by(Months) %>%
summarize(no = sum(total), yes = sum(BED.Contracts)/length(BED.Contracts))
Great!
wrt code snippet at 45:40
When i try the following piece of code....
flights %>%
group_by(carrier, flight, dest)%>%
tally(sort = TRUE)%>%
filter(n == 365)
... i get an error saying ->
Error in eval(expr, envir, enclos) : could not find function "desc"
BUT, if i remove the
"sort = TRUE" part in the tally command, it runs fine!!!
What might be the reason??
datasets link is not working. How to download these csv files
I think the datasetes are from the "nycflights13" package.
Actually, these are the Houston 2011 flights dataset, which is the "hflights" package, but you could probably use "nycflights13" just fine.
thx
thx