O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – understanding the effectiveness of histograms

Histograms are obtained using the hist and histogram functions. The choice of bin widths is also discussed.

  1. Have a buy-in of the R capability of the histograms through example(hist) and example(histogram) for the respective histogram functions from the graphics and lattice packages.
  2. Invoke the graphics editor with par(mfrow=c(2,2)).
  3. Create the histogram for the height of Child and Parent from the galton dataset seen in the earlier part of the section for the Freedman-Diaconis and Sturges choice of bin widths:
    par(mfrow=c(2,2)) hist(galton$parent,breaks="FD",xlab="Height of Parent", main="Histogram for Parent Height with Freedman-Diaconis Breaks",xlim=c(60,75)) hist(galton$parent,xlab="Height ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required