\documentclass{article} \usepackage{fullpage} \usepackage{amsmath} \setlength\parindent{0pt} % The percent symbol is mused to make comments % Enter title and author \title{Sweave Example} \author{Nathaniel E.\ Helwig} % use \date{} to suppress the date %\date{} \begin{document} \SweaveOpts{concordance=TRUE} \maketitle This is how you write basic math inline with text: $x + y = z$ \\ \bigskip This is how you write basic math in displayed equation: \[ x + y = z \] \bigskip This is how you write a matrix: \[ \mathbf{X} = \left( \begin{matrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23} \\ \end{matrix} \right) \] \bigskip This is how you make a numbered list: \begin{enumerate} \item First element of list \item Second element of list \end{enumerate} \bigskip This is how you make an unnumbered list: \begin{itemize} \item First element of list \item Second element of list \end{itemize} \bigskip This is how you include basic R code: <<>>= set.seed(1) x = rnorm(1000) mean(x) sd(x) y = rnorm(1000,mean=1,sd=2) mean(y) sd(y) @ \newpage This is how you include R code with figures: <>= set.seed(1) x = rnorm(1000) hist(x) @ \bigskip This is how you include the value $\pi = $ \Sexpr{pi} inline with text. \end{document}