Hi,
I was just following up with the video instructions and practicing the examples on my own, but I keep running into this problem. For some reason, the same code I enter doesn’t show me the two separate columns: unemployed and workforce. I am not sure what I am doing wrong or missing! I would really appreciate if someone can help me with this. Thank you.
Hi, I was just following up with the video instructions and practicing the examples on my own, but I keep running into this problem. For some reason, the same code I enter doesn’t show me the two separate columns: unemployed and workforce. I am not sure what I am doing wrong or missing! I would really appreciate if someone can help me with this. Thank you.
Here is the formula that I used:
library(tidyr) arizona<-arizona %>% mutate(variable=case_when( variable=="B23025_005" ~ "Unemployed", variable=="B23025_002" ~ "Workforce")) %>% select(-moe) %>% spread(variable, estimate) %>% #Spread moves rows into columns mutate(percent_unemployed=round(Unemployed/Workforce*100,2))