DS4PS / cpp-529-spr-2021

Course shell for CPP 529 Community Analytics
http://ds4ps.org/cpp-529-spr-2021/
2 stars 0 forks source link

Lab 2 question #3

Closed ayildiz84 closed 3 years ago

ayildiz84 commented 3 years ago

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))

lab 2 question

AntJam-Howell commented 3 years ago

Emailed you my reply already, just closing the case here.