Great talk, thanks! Really useful. Regarding tip #5 ("my favourite plot"); I was trying to figure out why coord_flip() is preferred to just swapping over x and y variables. e.g. ggplot(diamonds, aes(price, cut)) + geom_boxplot(). I read that doing that can put things in an unexpected order with some types of chart, and coord_flip() generally behaves better. It's never happened to me yet though.
This talk came out before flipping the x/y axis in barplots and boxplots was possible! As of today, you're absolutely right that flipping the x and y variables is the preferred solution :D
This is a great video. I learned a lot. I think there is an error in David's code at 10:41. He put a pipe operator after the ggplot instead of a plus (+) sign.
Where possible please include links to datasets as I find it helpful to be able to play around with the code you show; ideally with the source datasets.
Its not magrittr. Its a base function. in "x %/% y". It performs "x/y" and returns the integer part, no rounding up or down. It is equivalent to "floor(x/y)"
This is called Euclidean division - or division with remainder. When you type "1980:1989 %/% 10" it will return "198" ten times and discard the remainders (0,1,2,3,4, etc.) and because he multiplied the result with 10 he got the decades "1980" ten times.
I thought I was having problems with extract() but turns out magrittr also has a function called extract. Solved by tidyr::extract
(Great video btw)
It is so lovely to see a video with no down votes. April 17, 2020
Your comment inspired rebellion (not me).
13:26 is especially great. "Sometimes, when data is on different magnitudes, it's hard to reveal a trend on a regular scale ..."
Amazingly insightful!
Hope to get good as him some day! I'm a junior at Uni as a Stats major.
This video is awesome!
Great talk, thanks! Really useful. Regarding tip #5 ("my favourite plot"); I was trying to figure out why coord_flip() is preferred to just swapping over x and y variables. e.g. ggplot(diamonds, aes(price, cut)) +
geom_boxplot(). I read that doing that can put things in an unexpected order with some types of chart, and coord_flip() generally behaves better. It's never happened to me yet though.
This talk came out before flipping the x/y axis in barplots and boxplots was possible! As of today, you're absolutely right that flipping the x and y variables is the preferred solution :D
This man codes in R like he is on a speedrun. He is very fluent!!
This is a great video. I learned a lot. I think there is an error in David's code at 10:41. He put a pipe operator after the ggplot instead of a plus (+) sign.
Where possible please include links to datasets as I find it helpful to be able to play around with the code you show; ideally with the source datasets.
Can anyone explain the symbol '%/%'. Is that from maggritr?
Its not magrittr. Its a base function. in "x %/% y". It performs "x/y" and returns the integer part, no rounding up or down. It is equivalent to "floor(x/y)"
This is called Euclidean division - or division with remainder. When you type "1980:1989 %/% 10" it will return "198" ten times and discard the remainders (0,1,2,3,4, etc.) and because he multiplied the result with 10 he got the decades "1980" ten times.
%% and %/% are base operators in R! %% indicates x mod y and %/% indicates integer division. :)
Good info, lousy camera work
Respect!