We will be taking a look at the annual precipitation in US cities. As you glance at the data below, these are measured in millimeters. According to frontiersin written by Auguste Gires, he explains how raindrops are measured.
precip
## Mobile Juneau Phoenix Little Rock
## 67.0 54.7 7.0 48.5
## Los Angeles Sacramento San Francisco Denver
## 14.0 17.2 20.7 13.0
## Hartford Wilmington Washington Jacksonville
## 43.4 40.2 38.9 54.5
## Miami Atlanta Honolulu Boise
## 59.8 48.3 22.9 11.5
## Chicago Peoria Indianapolis Des Moines
## 34.4 35.1 38.7 30.8
## Wichita Louisville New Orleans Portland
## 30.6 43.1 56.8 40.8
## Baltimore Boston Detroit Sault Ste. Marie
## 41.8 42.5 31.0 31.7
## Duluth Minneapolis/St Paul Jackson Kansas City
## 30.2 25.9 49.2 37.0
## St Louis Great Falls Omaha Reno
## 35.9 15.0 30.2 7.2
## Concord Atlantic City Albuquerque Albany
## 36.2 45.5 7.8 33.4
## Buffalo New York Charlotte Raleigh
## 36.1 40.2 42.7 42.5
## Bismark Cincinnati Cleveland Columbus
## 16.2 39.0 35.0 37.0
## Oklahoma City Portland Philadelphia Pittsburg
## 31.4 37.6 39.9 36.2
## Providence Columbia Sioux Falls Memphis
## 42.8 46.4 24.7 49.1
## Nashville Dallas El Paso Houston
## 46.0 35.9 7.8 48.2
## Salt Lake City Burlington Norfolk Richmond
## 15.2 32.5 44.7 42.6
## Seattle Tacoma Spokane Charleston Milwaukee
## 38.8 17.4 40.8 29.1
## Cheyenne San Juan
## 14.6 59.2
"Sacramento" %in% names(precip)
## [1] TRUE
head(precip)
## Mobile Juneau Phoenix Little Rock Los Angeles Sacramento
## 67.0 54.7 7.0 48.5 14.0 17.2
tail(precip)
## Seattle Tacoma Spokane Charleston Milwaukee Cheyenne
## 38.8 17.4 40.8 29.1 14.6
## San Juan
## 59.2
max(precip)/min(precip)
## [1] 9.571429
precip[which.min(abs(precip-mean(precip)))]
## Cleveland
## 35
####The farthest from the mean rainfall?
precip[which.max(abs(precip-mean(precip)))]
## Mobile
## 67
hist(precip)