\HeaderA{asSimpleVector}{Example functions for the Chapter on Debugging}{asSimpleVector}
\aliasA{convertMode}{asSimpleVector}{convertMode}
\aliasA{setVNames}{asSimpleVector}{setVNames}
\aliasA{subsetAsCharacter}{asSimpleVector}{subsetAsCharacter}
\keyword{manip}{asSimpleVector}
\begin{Description}\relax
These functions are used to demonstrate some of the debugging
facilities in R.
\end{Description}
\begin{Usage}
\begin{verbatim}
asSimpleVector(x, mode = "logical")
convertMode(from, to)
setVNames(x, nm)
subsetAsCharacter(x, i, j)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] input 
\item[\code{mode}] the mode of \code{x} 
\item[\code{from}] a parameter
\item[\code{to}] another parameter
\item[\code{nm}] names for \code{x}
\item[\code{i}] an index
\item[\code{j}] another index
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A set of functions that can be used to demonstrate debugging principles 
and practices.

\code{asSimpleVector}  converts the argument \code{x} to a simple R
vector of the given mode preserving names, dimension and dimnames.

\code{subsetAsCharacter} calculates either a vector or a matrix subset of the
argument \code{x} and returns the subset after converting it to be of
mode character. It uses \code{asSimpleVector} to do the conversion to
character and thus also preserves any names, dimension or dimnames in the
subset.

\code{setVNames} sets the names of the given vector \code{x} to
the argument \code{nm} and then converts \code{x} to numeric
using \code{asSimpleVector}.

\code{convertMode} converts its first argument to
the mode of the second argument.
\end{Details}
\begin{Value}
Various values are returned.
\end{Value}
\begin{Author}\relax
S. DebRoy
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{browser}{browser}}
\end{SeeAlso}

