rough-r



In [4]:
states = read.csv(file='datasets/state.csv')
states


StatePopulationMurder.RateAbbreviation
Alabama 4779736 5.7 AL
Alaska 710231 5.6 AK
Arizona 6392017 4.7 AZ
Arkansas 2915918 5.6 AR
California 37253956 4.4 CA
Colorado 5029196 2.8 CO
Connecticut 3574097 2.4 CT
Delaware 897934 5.8 DE
Florida 18801310 5.8 FL
Georgia 9687653 5.7 GA
Hawaii 1360301 1.8 HI
Idaho 1567582 2.0 ID
Illinois 12830632 5.3 IL
Indiana 6483802 5.0 IN
Iowa 3046355 1.9 IA
Kansas 2853118 3.1 KS
Kentucky 4339367 3.6 KY
Louisiana 4533372 10.3 LA
Maine 1328361 1.6 ME
Maryland 5773552 6.1 MD
Massachusetts 6547629 2.0 MA
Michigan 9883640 5.4 MI
Minnesota 5303925 1.6 MN
Mississippi 2967297 8.6 MS
Missouri 5988927 6.6 MO
Montana 989415 3.6 MT
Nebraska 1826341 2.9 NE
Nevada 2700551 6.0 NV
New Hampshire 1316470 0.9 NH
New Jersey 8791894 3.9 NJ
New Mexico 2059179 4.8 NM
New York 19378102 3.1 NY
North Carolina 9535483 5.1 NC
North Dakota 672591 3.0 ND
Ohio 11536504 4.0 OH
Oklahoma 3751351 4.5 OK
Oregon 3831074 2.0 OR
Pennsylvania 12702379 4.8 PA
Rhode Island 1052567 2.4 RI
South Carolina 4625364 6.4 SC
South Dakota 814180 2.3 SD
Tennessee 6346105 5.7 TN
Texas 25145561 4.4 TX
Utah 2763885 2.3 UT
Vermont 625741 1.6 VT
Virginia 8001024 4.1 VA
Washington 6724540 2.5 WA
West Virginia 1852994 4.0 WV
Wisconsin 5686986 2.9 WI
Wyoming 563626 2.7 WY

In [15]:
pop = states['Population']
mean(states[['Population']])


6162876.3

In [17]:
mean(states[['Population']], trim = 0.1)


4783697.125

In [ ]: