\HeaderA{Return.read}{Read returns data with different date formats}{Return.read}
\keyword{ts}{Return.read}
\keyword{multivariate}{Return.read}
\keyword{distribution}{Return.read}
\keyword{models}{Return.read}
\begin{Description}\relax
A simple wrapper of read.zoo with some defaults for different date formats and xts conversion
\end{Description}
\begin{Usage}
\begin{verbatim}
Return.read(filename = stop("Please specify a filename"),
                 frequency = c("d", "m", "q", "i", "o"), format.in =
                 c("ISO8601", "excel", "oo", "gnumeric"), sep = ",",
                 header = TRUE, check.names = FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] the name of the file to be read 
\item[\code{frequency}] \Itemize{
\item "d" sets as a daily timeseries using \code{\LinkA{as.Date}{as.Date}},
\item "m" sets as monthly timeseries using \code{\LinkA{as.yearmon}{as.yearmon}},
\item "q" sets as a quarterly timeseries using \code{\LinkA{as.yearqtr}{as.yearqtr}}, and
\item "i" sets as irregular timeseries using \code{\LinkA{as.POSIXct}{as.POSIXct}}
}

\item[\code{format.in}] says how the data being read is formatted.  Although
the default is set to the ISO 8601 standard (which can also be set as "\%F"),
most spreadsheets have less sensible date formats as defaults. See below.

\item[\code{sep}] separator, default is "," 
\item[\code{header}] a logical value indicating whether the file contains the
names of the variables as its first line.

\item[\code{check.names}] logical. If TRUE then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names. If necessary they are adjusted (by make.names) so that they are, and also to ensure that there are no duplicates. See \code{\LinkA{read.table}{read.table}} 
\item[\code{...}] passes through any other parameters to \code{\LinkA{read.zoo}{read.zoo}} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The parameter 'format.in' takes several values, including:
\Itemize{
\item excel: default date format for MS Excel spreadsheet csv format, which is "\%m/\%d/\%Y",
\item oo: default date format for OpenOffice spreadsheet csv format, "\%m/\%d/\%y", although this may be operating system dependent,
\item gnumeric: default date format for Gnumeric spreadsheet, which is "\%d-\%b-\%Y",
\item ...: alternatively, any specific format may be passed in, such as "\%M/\%y"
}
\end{Details}
\begin{Value}
An xts object containing a representation of the data in the file.
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{read.zoo}{read.zoo}}, \code{\LinkA{read.table}{read.table}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
     ## Not run: 
     Return.read("managers.cvs", frequency="d")
     
## End(Not run)

\end{ExampleCode}
\end{Examples}

