1 / 10

Graphing Parameters

The R Graphics Package. Graphing Parameters. Basic Chart Types. Histogram. Line. Titles X-Axis Title Y-Axis Title Legend Scales Color Gridlines. Scatter. Box. library(help="graphics"). Histogram of NFL Offense.

opal
Download Presentation

Graphing Parameters

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The R Graphics Package • Graphing Parameters • Basic Chart Types Histogram Line Titles X-Axis Title Y-Axis Title Legend Scales Color Gridlines Scatter Box library(help="graphics")

  2. Histogram of NFL Offense hist(nfl$OffPtsA,freq=F, breaks = 25, ylim = c(0,0.14), col = "blue") curve(dnorm(x, mean=mean(nfl$OffPtsA), sd=sd(nfl$OffPtsA)), col="purple", add=T)

  3. Grammar of Graphics Seven Components formations Legend Axes

  4. ggplot2 Components The anatomy of a graph

  5. ggplot2 In ggplot2 a plot is made up of layers. Pl o t

  6. ggplot2: geoms http://docs.ggplot2.org/current/

  7. ggplot2: histogram

  8. Histograms: NFL Example • Create the plot object: nflHistogram <- ggplot(nfl, aes(OffPtsA)) + opts(legend.position = "none") • Add the graphical layer: nflHistogram+ geom_histogram(binwidth = 0.4 ) + labs(x = "NFL Offense Points", y = "Frequency")

  9. Scatterplot: NFL Example

  10. rCharts: Scatterplot

More Related