IDS 472 HW1.docx - #E How many white males with at least a high school education were killed by guns in 2012 ed_male_gun<-subset(gun_deaths,education

# IDS 472 HW1.docx - #E How many white males with at least a...

• 2

This preview shows page 1 - 2 out of 2 pages.

#E) How many white males with at least a high school education were killed by guns in 2012? ed_male_gun<-subset(gun_deaths,education =="Less than high school"& sex=="M"& year=="2012" & race=="White") unique(ed_male_gun\$education) ## BA+, HS/GED,Some college Less than HS ## Level: Less than HS HS/GED gun_death_race=dplyr::count(ed_male_gun, race) arrange(gun_death_race,desc(n))%>% kable(col.names= c("Race","Number of deaths") #F) Which season of the year has the most gun deaths? Assume that Winter = January - March, Spring = April - June, Summer = July - September, Fall = October - December, Hint: You need to convert a continuous variable into a categorical variable season_deaths<-mutate(gun_deaths, season=as.factor(mapvalues(month, c(1,2,3,4,5,6,7,8,9,10,11,12), c("Summer","Summer","Fall","Fall""Winter", "Winter")))) season_deaths<-as.tibble(season_deaths) season_gun_death=dplyr::count(season_deaths,season)

Subscribe to view the full document.

• Fall '08
• STAFF

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes