\HeaderA{checkData}{check input data type and format and coerce to the desired output type}{checkData}
\keyword{ts}{checkData}
\keyword{multivariate}{checkData}
\keyword{distribution}{checkData}
\keyword{models}{checkData}
\begin{Description}\relax
This function was created to make the different kinds of data classes at least \emph{seem} more fungible.  It allows the user to pass in a data object without being concerned that the function requires a matrix, data.frame, or timeSeries object.  By using this, the function "knows" what data format it has to work with.
\end{Description}
\begin{Usage}
\begin{verbatim}
checkData(x, method = c("xts", "zoo", "data.frame", "matrix","vector"), na.rm = TRUE, quiet = TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector, matrix, data.frame, xts, timeSeries or zoo object to be checked and coerced 
\item[\code{na.rm}] TRUE/FALSE Remove NA's from the data? used only with 'vector' 
\item[\code{quiet}] TRUE/FALSE if false, it will throw warnings when errors are noticed, default TRUE 
\item[\code{method}] type of coerced data object to return, one of c("zoo","matrix","vector"), default "zoo" 
\item[\code{...}] any other passthru parameters 
\end{ldescription}
\end{Arguments}
\begin{Value}
checkData will make a reasonable assumption, or return the object type requested by method
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{Examples}
\begin{ExampleCode}
data(edhec)
x = checkData(edhec)
class(x)
head(x)
tail(x)
# Note that passing in a single column loses the row and column names
x = checkData(edhec[,1])
class(x)
head(x)
# Include the "drop" attribute to keep row and column names
x = checkData(edhec[,1,drop=FALSE])
class(x)
head(x)
x = checkData(edhec, method = "matrix")
class(x)
head(x)
x = checkData(edhec[,1], method = "vector")
class(x)
head(x)
\end{ExampleCode}
\end{Examples}

