%I have commented out the lines of code that will automatically be put into a Sweave document %A Sweave document will have to be saved with a .Rnw extension! %\documentclass{article} %\begin{document} %\SweaveOpts{concordance=TRUE} %This LateX command will leftjustify all the output (not necessary). \begin{flushleft} Name 1\\ STAT 575 Homework \#0\\ \vspace*{2\baselineskip} %or can use %\bigskip Problem from Lab\\ Part A\\ %This is a chunk of R code <<1a, echo=TRUE, eval=TRUE, background="white", include=TRUE, fig=TRUE>>= set.seed(1) bindat <- rbinom(n=10000, size=10, prob=0.8) par(mfrow=c(1,1)) hist(bindat, breaks=seq(2, 10, 1), freq=F) @ Part B\\ %This a new chunk of R code with NO figure <<1b, echo=TRUE, eval=TRUE, background="white", include=TRUE, fig=FALSE>>= 1-pbinom(7, 10, 0.8) @ The probability that Dr. Dribble makes at least 8 out 10 free throws is 0.6778. \pagebreak %For Part C, below, let's make the plot of the SDF plot from Example 3: % 1) In HW#2, there was a SDF that you were asked to plot. 3.4(b) %S(x) = 1/(1+x)^2, x>0. Part C\\ %Put your new chunk of R code below %This LateX command will end the leftjustify all the output. \end{flushleft} %\end{document}