Qqqq q q q q qqq q qqq qqqq q q qq q q qq qq q qq q

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: q q q q qq 4.5 qq q q qq q q q qq q q q q qq q qq qq qq q qqq qq q qqq qq qq qqq q qq qq qq qq q q qqq q q qq q q q qq q q q qq q qqq q qqqq q q q q q q q q q q q qq q qq qqqq qqq q qq qqq q qq q q q q q qq q q q qq qq q qqq qqq qq qq q q qqq q q q q q qq qq qqqqq qq q q qq q q qqqq qqqqqqqq qq q q q qqqq q q qq q qq qq q q qq q 28 qq q q qqq q q q qq q qq qqq qq q q qq q qq qq q q q q q qq q q q qq q q q qq q q q qq q q qq qq q qq q q qq q qq qq q q qqq q q q qq q q q qq q q q q qq q q qq qq q q q qq q q q qq q q q qq q q q q q qq q q 4.5 5.5 6.5 7.5 Sepal.Length 0.5 1.0 1.5 2.0 2.5 q q q q q 3.0 q 2.0 q 1.0 q 1234567 2.0 2.5 3.0 3.5 4.0 qqqqqq 3 4 5 6 7 1.0 1.5 2.0 2.5 3.0 Math Annotations ⇒ ?plotmath gives documentation on it. > demo(plotmath) gives examples by commands and results. Murrell, P. and Ihaka, R. (2000) "An approach to providing mathematical annotation in plots." Journal of Computational and Graphical Statistics, 9, 582-599. 29 Normal Sample Histogram and Density normalhist <- function(n=1000){ x <- rnorm(n) xx <- seq(-4,4,.1) hist(x,breaks=xx,probability=T, main="normal histogram") yy <- dnorm(xx) lines(xx,yy,col="blue") text(-4,.3,expression(varphi(x)== over(1,sqrt(2*pi))*phantom(0)* e^{-x^2/2}),adj=0,col="blue") } 30 ϕ(x) = 1 2π e−x 2 2 0.0 0.1 0.2 Density 0.3 0.4 0.5 normal histogram −4 −2 0 x 31 2 4 Saving Plots We indicated the interactive way within the RStudio interface. There are also various other ways by direct commands. pdf(file="myplot.pdf", width=8,height=6) opens pdf-le "myplot.pdf". width, height are in inches. Any subsequent graphics commands produce output to that le, until dev.off() is issued, or the R session terminates. Similar commands exist for other graphics formats ⇒ ?Devices for tiff, jpeg, bmp, png, postscript, quartz (Mac). 32 More Powerful Graphics Add-on packages provide more graphics capabilities. We mention just three. These are too complex to delve into here. Good as projects. The lattice package. ⇒ Book: Lattice: Multivariate Data Visualization with R, Springer 2008, by Deepayan Sarkar, creator of the package. The ggplot2 package, not covered here, but see R Graphics Cookbook by Winston Chang, O'Reilly, 2013. Interactive and Dynamic Graphics for Data Analysis with R and , Springer 2007, by Dianne Cook and Deborah Swayne. GGobi 33...
View Full Document

This note was uploaded on 02/25/2014 for the course STAT 302 taught by Professor Fritz during the Winter '13 term at University of Washington.

Ask a homework question - tutors are online