\documentclass[a4paper]{article} \title{A \emph{brew} Test File} \author{\emph{Jeffrey Horner}} \usepackage{a4wide,graphicx} \begin{document} \maketitle A simple example that will run in any \emph{R} engine \emph{(brew may work with S, but this is untested)}: The integers from 1 to 10 are \begin{verbatim} 1 2 3 4 5 6 7 8 9 10 \end{verbatim} We can also emulate a simple calculator \emph{(although the syntax is not as elegant as Sweave)}: \begin{verbatim} > 1+1 [1] 2 > 1+pi [1] 4.141593 > 1+pi [1] 4.141593 > sin(pi/2) [1] 1 \end{verbatim} Now we look at Gaussian data: \begin{verbatim} [1] 1.37095845 -0.56469817 0.36312841 0.63286260 0.40426832 -0.10612452 [7] 1.51152200 -0.09465904 2.01842371 -0.06271410 1.30486965 2.28664539 [13] -1.38886070 -0.27878877 -0.13332134 0.63595040 -0.28425292 -2.65645542 [19] -2.44046693 1.32011335 One Sample t-test data: x t = 0.65387, df = 19, p-value = 0.521 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -0.422409 0.806249 sample estimates: mean of x 0.19192 \end{verbatim} Note that we can easily integrate some numbers into standard text: The third element of vector \texttt{x} is 0.3631284, the $p$-value of the test is 0.52103. % $ Now we look at a summary of the famous iris data set, and we want to see the commands in the code chunks \emph{(brew can't show you the code, so don't look for it)}: \begin{verbatim} Sepal.Length Sepal.Width Petal.Length Petal.Width Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300 Median :5.800 Median :3.000 Median :4.350 Median :1.300 Mean :5.843 Mean :3.057 Mean :3.758 Mean :1.199 3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu.:1.800 Max. :7.900 Max. :4.400 Max. :6.900 Max. :2.500 Species setosa :50 versicolor:50 virginica :50 \end{verbatim} \begin{figure}[htbp] \begin{center} \includegraphics{brew-test-1-1} \caption{Pairs plot of the iris data.} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics{brew-test-1-2} \caption{Boxplot of sepal length grouped by species.} \end{center} \end{figure} \end{document}