hist() bins a numeric vector and draws a histogram, with main setting the title. Wrapped between png() and dev.off(), it writes rhist.png instead of opening a window. Histograms reveal the shape, center, and spread of a distribution at a glance. Adjust bin width with the breaks argument, such as breaks=50.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.