I need to create an exam using examdesign but am having trouble creating graphs in my code. The following code works fine, using \includegraphics to take a pre-made graph.
But I'd like to draw the graph within the sweave document. The code I'd *like* to use follows further before.
Thank you! Simon Kiss
Code: Select all
\documentclass[letter]{examdesign}
\class{OL344 - Social Science Research Methods 2 (Survey Research)}
\begin{document}
\begin{shortanswer}[title={Short answer questions}]
\begin{block}
\includegraphics{/Users/simon/Documents/fluoridation/summary/fluoride-006.pdf}
\begin{question}
What is the relationship between the mean, median and mode when data are normally distributed?
\end{question}
\end{block}
\end{shortanswer}
\end{document}
Code: Select all
\documentclass[letter]{examdesign}
\class{OL344 - Social Science Research Methods 2 (Survey Research)}
\begin{document}
\begin{shortanswer}[title={Short answer questions}]
\begin{block}
<<fig=true, eval=true, include=true>>=
barplot(matrix(c(50,50,50, 50), nrow=2, dimnames=list(Gender=c('Male', 'Female'), Voted=c('Did Not Vote', 'Voted'))))
@
\begin{question}
What is the relationship between the mean, median and mode when data are normally distributed?
\end{question}
\end{block}
\end{shortanswer}
\end{document}