-
-
Save kszela24/80e918d59fa2bfde97196d69a2f2eda3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Subset census data by those making full-time incomes with age >=18. | |
education_numbers = census[(census$full.or.part.time.employment.stat == "Full-time schedules" & | |
census$age >= 18),] | |
#New levels by increasing education | |
new_levels = c("Children", "Less than 1st grade", "1st 2nd 3rd or 4th grade", | |
"5th or 6th grade", "7th and 8th grade", "9th grade", "10th grade", | |
"11th grade", "12th grade no diploma", "High school graduate", | |
"Associates degree-academic program", "Associates degree-occup /vocational", | |
"Some college but no degree", "Bachelors degree(BA AB BS)", | |
"Masters degree(MA MS MEng MEd MSW MBA)", "Doctorate degree(PhD EdD)", | |
"Prof school degree (MD DDS DVM LLB JD)") | |
#Refactoring | |
education_numbers$education = factor(education_numbers$education, levels = new_levels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment