\Header{is.R}{Are we using \R, rather than S?}
\keyword{environment}{is.R}
\keyword{utilities}{is.R}
\begin{Usage}
\begin{verbatim}
is.R()
\end{verbatim}
\end{Usage}
\begin{Description}
\texttt{is.R} returns \texttt{TRUE} if we are using \R\ and \texttt{FALSE}
otherwise.

The function has been written such as to correctly run in all versions
of \R, S and S-plus.
In order for code to be runnable in both \R\ and S dialects, either
your the code must define \texttt{is.R} or use it as

\texttt{if (exists(is.R) \&\& is.function(is.R) \&\& is.R()) \{}\\{}
\texttt{    }\emph{\#\# R-specific code}\\{}
\texttt{\} else \{}\\{}
\texttt{    }\emph{\#\# S-version of code}\\{}
\texttt{\}}\end{Description}
\begin{SeeAlso}
\texttt{\Link{version}}, \texttt{\Link{system}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- runif(20); small <- x < 0.4
# which only exists in R:
if(is.R()) which(small) else seq(along=small)[small]
\end{ExampleCode}
\end{Examples}

