10.30 Random Observations

20180721 It is also useful to review some random observations from the dataset to provide a little more insight. Here we use dplyr::sample_n() to randomly select six rows from the dataset.

# Review a random sample of observations.

sample_n(ds, size=6) %>% print.data.frame()
##         date      location min_temp max_temp rainfall evaporation sunshine
## 1 2009-07-19 BadgerysCreek     -0.3     19.5      0.0          NA       NA
## 2 2017-05-30 SydneyAirport      6.8     19.0      0.0         3.4      9.7
## 3 2017-03-06      Brisbane     22.7     31.5      0.2         6.0     10.8
## 4 2010-12-07  PerthAirport     13.9     24.3      0.2         4.4     11.9
## 5 2020-06-22   Tuggeranong      0.7     11.3      1.2          NA       NA
## 6 2012-10-04  PerthAirport      9.7     19.6      1.2         5.4      6.2
##   wind_gust_dir wind_gust_speed wind_dir_9am wind_dir_3pm wind_speed_9am
## 1           WSW              30         <NA>            W              0
## 2             W              39           NW           NW             17
## 3           ENE              26            W            E              2
## 4           WSW              41          SSW           SW             20
## 5            NW              24         <NA>          WNW              0
## 6             S              35            N          SSW              9
##   wind_speed_3pm humidity_9am humidity_3pm pressure_9am pressure_3pm cloud_9am
## 1             13           94           38       1021.1       1019.4        NA
## 2             19           56           38       1023.2       1020.1         1
## 3             15           62           52       1010.2       1007.7         5
## 4             28           55           47       1006.9       1007.1         5
## 5              9          100           52       1011.2       1009.0        NA
## 6             22           78           50       1019.7       1017.9         7
##   cloud_3pm temp_9am temp_3pm rain_today risk_mm rain_tomorrow
## 1        NA      7.6     19.3         No     0.2            No
## 2         6     12.0     17.8         No     0.2            No
## 3         2     26.9     30.0         No     0.0            No
## 4         3     20.7     22.5         No     0.0            No
## 5        NA      2.9     10.2        Yes     0.0            No
## 6         7     15.3     18.9        Yes     0.0            No


Your donation will support ongoing development and give you access to the PDF version of the book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.