5.8 More subsetting with dplyr
Now, let’s ask another question of the snow data: Which Boston winters had snowfall of at least 72 inches (6 feet)?
Again we’ll use a condition, this time that the Boston column is greater or equal to 72. I’ll store the results in a new variable that I’ll call boston72 and then view the results:
## Winter Boston Chicago NYC
## 1 1947-1948 89.2 38.1 63.2
## 2 1977-1978 85.1 82.3 50.7
## 3 1992-1993 83.9 46.9 24.5
## 4 1993-1994 96.3 41.8 53.4
## 5 1995-1996 107.6 23.9 75.6
## 6 2004-2005 86.6 39.4 41.0
## 7 2010-2011 81.0 57.9 61.9
## 8 2014-2015 110.6 50.7 50.3
Including data for other cities doesn’t make sense for this question, so, let’s select just the Winter and Boston columns, and then sort the results from highest to lowest: