
ComputerProject1:Duedate,MondayJune8,2009
Instructions:WriteyousolutionsinaWordfile(orpreferablypdffile)andalongwithyourRprogram(s)
e‐mailthemtomeinasinglezip‐file.Thenameofthezip‐fileshouldbeYourLastName1.zip,where
“YourLastName”isreplacedbyyourlastname.Yoursolutionshouldincludeyourinputandoutputfiles,
organizednicely.
ThegoalofthisexerciseistofamiliarizeyouwithinputtingdataintoR,manipulatingdata,andgetting
youfamiliarwithsomegraphicfunctionsinR.Makesurethatyourplotsarecompletelylabeled,
includingamaintitle,andx‐labelandy‐label,wheneverrelevant.
1. Considerthe
followingdata:
CrashTestData: Databasedontrialsinwhichstockautomobilesarecrashedintoawallat35MPH
withdummiesinthedriverandfrontpassengerseat.
Reference:NationalTransportationSafetyAdministration
Numberofcases:352
VariableNames:
1) Make:Carmake
2) Model:Modelofthatcar
3) carID:Usuallythecombinationofmakeandmodel
4) carID_&_Year:FullIDofthecar
5) Head_IC:Headinjurycriterion
6) Chest_decel:Chestdeceleration
7) L_Leg:Leftfemurload
8) R_Leg:Rightfemurload
9) D/P:WhetherthedummyisintheDriverorPassengerseat
10) Protection:Kindofprotection(seatbelt,airbag,etc.)
11) Doors:Numberofdoorsonthecar
12) Year:Yearofthecar
13) Wt:Weightinpounds
14) Size:Acategoricalvariabletoclassifythecarstoatype(light,minivan)
a) Giveabarplotthatindicatesthenumberofeachtypeofprotectionused.Thecolorofthebars
shouldbered.Note,it’sbestthatbarplotsareorderedfromlargesttosmallest.
b) Giveabarplotthatindicatesthepercentageofeachtypeofprotectionused.
c) Giveapie‐chartthatindicatesthepercentageofeachtypeofprotectionused.Makesurethat
thepieslicecorrespondingto“manualbelts”isred,andthepercentagesappearwiththeslice
labels.