\documentclass[b5paper,12pt]{article}
\usepackage{Sweave}

\begin{document} % Body of the document

\textsf{R} as a calculator:

\begin{Schunk}
\begin{Sinput}
> 1 + 1
\end{Sinput}
\begin{Soutput}
[1] 2
\end{Soutput}
\begin{Sinput}
> 1 + pi
\end{Sinput}
\begin{Soutput}
[1] 4.141593
\end{Soutput}
\begin{Sinput}
> sin(pi/2)
\end{Sinput}
\begin{Soutput}
[1] 1
\end{Soutput}
\end{Schunk}

Image:

\begin{Schunk}
\begin{Sinput}
> plot(1:20)
\end{Sinput}
\end{Schunk}
\includegraphics{test_sweave-002}
\end{document}
