\HeaderA{export.root}{Export data from ROOT file}{export.root}
\keyword{manip}{export.root}
\begin{Description}\relax
Export data as text files directly from a \code{\LinkA{ROOT}{ROOT}} file.
\end{Description}
\begin{Usage}
\begin{verbatim}
export.root(datafile = character(0), schemefile = character(0), treeset = character(0), treename = "*", treetype = character(0), varlist = "*", outfile = character(0), sep = "\t", as.dataframe = FALSE, verbose = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{datafile}] name of ROOT data file including full path
\item[\code{schemefile}] name of ROOT scheme file including full path
\item[\code{treeset}] name of subdirectory in ROOT file where trees are stored
\item[\code{treename}] name of ROOT tree to export.
\item[\code{treetype}] type of tree(s) to export, see \code{\LinkA{validTreetype}{validTreetype}}.
\item[\code{varlist}] names of tree leaves to export.
\item[\code{outfile}] name of output file.
\item[\code{sep}] column separator
\item[\code{as.dataframe}] if \code{TRUE} a data.frame will be returned.
\item[\code{verbose}] logical, if \code{TRUE} print status information.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Export data as text files directly from a \code{\LinkA{ROOT}{ROOT}} file.
\end{Details}
\begin{Value}
If \code{as.dataframe} is \code{TRUE}, the data will be imported into the
current R session as \code{data.frame}. Otherwise, \code{NULL} will be returned.
\end{Value}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{export}{export}}, \code{\LinkA{export-methods}{export.Rdash.methods}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## export data directly from root file
schemefile <- paste(.path.package("xps"),"schemes/SchemeTest3.root",sep="/")
datafile   <- paste(.path.package("xps"),"rootdata/DataTest3_cel.root",sep="/")
data <- export.root(datafile, schemefile, "DataSet", "*", "cel", "*", "DataOutFile.txt", as.dataframe = TRUE,verbose=FALSE)
head(data)
\end{ExampleCode}
\end{Examples}

