%--- This is used for the  ${RHOME}/etc/Rd2dvi  command :
\documentclass[a4paper]{book}
\usepackage{Rd2}
\usepackage{makeidx}

\makeindex

\begin{document}
\section*{\R\ documentation --- \today}
\input{Rd2}
\printindex
\end{document}
