Using readxl and dplyr to format messy data to see change in poverty with R (CC335)

  Рет қаралды 1,133

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 16
@muhammedhadedy4570
@muhammedhadedy4570 12 күн бұрын
Oh Allah. This video alone worth tons of paid courses. I really don't know how to thank you. I appreciate your work, my dear professor. Greetings from Egypt. ❤❤❤❤
@Riffomonas
@Riffomonas 12 күн бұрын
Fantastic! Glad it was useful 🤓
@borinsroy8992
@borinsroy8992 12 күн бұрын
At 16:44 use mutate(across(-name, as.numeric))
@ahmed007Jaber
@ahmed007Jaber 11 күн бұрын
Nicely executed, Pat If i were to do it, i would approach it differently I would use regex to extract the \\d{4} as year Then fill down NAs Then skip the first couple of tows Then mutate(across(colname:colname,as.numeric)) Then rename
@ahmed007Jaber
@ahmed007Jaber 11 күн бұрын
Last step would be to promot first row as headers after skipping the top The interesting wonder would be, how would you approach annotating peaks and bottoms in the line. Dynamic annotating so that whatever changes it updates
@tedhermann3424
@tedhermann3424 15 күн бұрын
Great video! I think what you wanted for converting all your columns to numeric was the across function. e.g., mutate(across(total:percent, as.numeric). You can use it with summarize as well. Also, FYI, the code in your linked blog post looks to be from your gapminder episode! Any thoughts on your next series? The targets package or tidymodels could be interesting.
@Riffomonas
@Riffomonas 15 күн бұрын
Thanks for the across tip! I'll keep tidymodels in mind for the future
@PeperazziTube
@PeperazziTube 15 күн бұрын
One small point of pedantic nitpicking: taking the average poverty rate of all states is not the average national poverty rate, as the population of states varies by 2 orders of magnitude. The original data has the population data by state/year, so a national average could be calculated by data %>% summarize(pct_national = sum(in_poverty)/sum(population, .by = year)
@Riffomonas
@Riffomonas 15 күн бұрын
You're of course correct - thanks for catching this! When I used code like yours it doesn't appear that the line moves meaningfully from what I had in the video. Well done 🤓
@PhilippusCesena
@PhilippusCesena 14 күн бұрын
Thanks for the very useful video, unfortunately we often find ourselves having to deal with datasets that have been collected in a rather unorganized manner.
@Riffomonas
@Riffomonas 14 күн бұрын
There used to be a hashtag .... #otherpeoplesdata that cataloged some of the more humorous challenges🤓
@fabianhellmold9331
@fabianhellmold9331 15 күн бұрын
Another great video. Your plots have helped me a lot for the visualization of a master thesis. When using lineend = “round”, I noticed that the keys in the legend change strangely. Any tips on how to fix this?
@Riffomonas
@Riffomonas 15 күн бұрын
Thanks! Hmmm, I'm not seeing that. If I do the following it looks ok... library(tidyverse) library(gapminder) gapminder %>% filter(country %in% c("India", "Afghanistan")) %>% ggplot(aes(x = year, y = lifeExp, color = country)) + geom_line(lineend = "round", linewidth = 2)
@fabianhellmold9331
@fabianhellmold9331 14 күн бұрын
@@Riffomonas In my example, I work simultaneously with geom_line and geom_segment, which each have different color groupings. Lineend=“round” draws lines in the keys, which then extend to the left and right. To stay with your code: library(tidyverse) library(gapminder) gapminder %>% filter(country %in% c("India", "Pakistan")) %>% ggplot(aes(x = year, y = lifeExp, color = country)) + geom_segment(aes(y = gdpPercap/10, xend = year, yend = 0, color = factor(gdpPercap > mean(gdpPercap))), linewidth = 4.8, alpha = 1) + geom_line(lineend = "round", linewidth = 2)
@Riffomonas
@Riffomonas 14 күн бұрын
@@fabianhellmold9331 Hey - I'm not seeing a difference if lineend="round" or not. It looks like the four values of country have two differeent line widths. If you want to simplify the legend to only have one linewidth, you could add this to the end of your code... + scale_color_discrete(guide = guide_legend(override.aes = list(linewidth = 1)))
@fabianhellmold9331
@fabianhellmold9331 14 күн бұрын
@@Riffomonas Thankts allot! That actually improved my Legend :)
Excel Formulas and Functions | Full Course
52:40
Kevin Stratvert
Рет қаралды 1,8 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Data Analysis with Python for Excel Users - Full Course
3:57:46
freeCodeCamp.org
Рет қаралды 3,5 МЛН
MIT Introduction to Deep Learning | 6.S191
1:09:58
Alexander Amini
Рет қаралды 892 М.
Excel for Beginners - The Complete Course
54:55
Technology for Teachers and Students
Рет қаралды 8 МЛН
Ultimate Excel PivotTables Tutorial: Beginner to Advanced - 3.5 Hours!
3:25:48
Data Cleaning in Pandas | Python Pandas Tutorials
38:37
Alex The Analyst
Рет қаралды 365 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН