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

2.

Verify Sacramento is in the data.

"Sacramento" %in% names(precip)
## [1] TRUE

3.

Which 5 cities receive the most rain?

head(precip)
##      Mobile      Juneau     Phoenix Little Rock Los Angeles  Sacramento 
##        67.0        54.7         7.0        48.5        14.0        17.2

The least rain?

tail(precip)
## Seattle Tacoma        Spokane     Charleston      Milwaukee       Cheyenne 
##           38.8           17.4           40.8           29.1           14.6 
##       San Juan 
##           59.2

4.

How many times larger is the rainfall in the rainiest city compared to the least rainy cit

max(precip)/min(precip)
## [1] 9.571429

5.

Which city is closest to the mean rainfall?

precip[which.min(abs(precip-mean(precip)))]
## Cleveland 
##        35

####The farthest from the mean rainfall?

precip[which.max(abs(precip-mean(precip)))]
## Mobile 
##     67

6.

Plot a histogram of precipitation. Interpret this histogram in one or two sentence.

  • As shown below, precipitation is more skewed to the right. This means it rains more than usual.
hist(precip)

7.

The following plot represents this data. What other data are necessary to create this plot?

  • If I were to include data of different sea levels within each region, this wouild affect how much precipitation each cities have in a year.

8.

What general patterns in annual precipitation does the following plot suggest?

  • The patterns suggests a higher amount of precipitation at the south-east coast.