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 2011-12-30  PerthAirport     18.0     31.6      0.0         7.8     10.9
## 2 2010-05-09    Townsville     16.0     27.3      0.0         6.4      4.4
## 3 2017-06-29 NorfolkIsland     14.0     19.2      0.0         3.0       NA
## 4 2012-06-18        Cairns     16.5     26.5      0.0         6.2      9.5
## 5 2020-01-18 SydneyAirport     18.2     22.8     14.0         3.2      0.0
## 6 2015-02-14          Sale     18.5     23.0     15.6          NA       NA
##   wind_gust_dir wind_gust_speed wind_dir_9am wind_dir_3pm wind_speed_9am
## 1           WSW              35            N          WSW              9
## 2            SE              41          SSW           SE              9
## 3           SSE              30          SSE           SE             17
## 4            SE              44            S           SE             19
## 5           SSW              61          SSW          SSW             43
## 6             E              28           SE          ESE              9
##   wind_speed_3pm humidity_9am humidity_3pm pressure_9am pressure_3pm cloud_9am
## 1             20           64           53       1003.3       1003.1         5
## 2             22           47           65       1015.3       1011.9         2
## 3             13           57           54       1024.0       1022.1        NA
## 4             30           67           56       1020.1       1016.5         6
## 5             31           85           82       1009.1       1009.2         8
## 6             15           97           95       1019.5       1017.0         8
##   cloud_3pm temp_9am temp_3pm rain_today risk_mm rain_tomorrow
## 1         3     26.7     29.4         No     0.0            No
## 2         7     24.2     24.2         No     0.2            No
## 3        NA     17.1     17.5         No     0.0            No
## 4         3     22.5     25.4         No     0.0            No
## 5         8     21.5     21.7        Yes     3.6           Yes
## 6         7     18.9     19.7        Yes    35.2           Yes


Your donation will support ongoing development and give you access to the PDF version of this 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.