\HeaderA{read.columns}{Read specified columns from a file}{read.columns}
\keyword{file}{read.columns}
\begin{Description}\relax
Reads specified columns from a file in table format and creates a data frame from it, with cases corresponding to lines and variables to fields in the file.
\end{Description}
\begin{Usage}
\begin{verbatim}
read.columns(file,required.col=NULL,text.to.search="",sep="\t",quote="\"",skip=0,fill=TRUE,blank.lines.skip=TRUE,comment.char="",allowEscapes=FALSE,...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{file}] the name of the file which the data are to be read from.
\item[\code{required.col}] character vector of names of the required columns
\item[\code{text.to.search}] character string. If any column names can be found in this string, those columns will also be read.
\item[\code{sep}] the field separator character
\item[\code{quote}] character string of characters to be treated as quote marks
\item[\code{skip}] the number of lines of the data file to skip before beginning to read data.
\item[\code{fill}] logical: if \code{TRUE} then in case the rows have unequal length, blank fields are implicitly added.
\item[\code{blank.lines.skip}] logical: if \code{TRUE} blank lines in the input are ignored.
\item[\code{comment.char}] character: a character vector of length one containing a single character or an empty string.
\item[\code{allowEscapes}] logical. Should C-style escapes such as \code{\bsl{}n} be processed or read verbatim (the default)?
\item[\code{...}] other arguments are passed to \code{read.table}, excluding the following
which are reserved and cannot be set by the user:
\code{header}, \code{col.names}, \code{check.names} and \code{colClasses}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function is an interface to \code{read.table} in the base package.
It uses \code{required.col} and \code{text.to.search} to set up the \code{colClasses} argument of \code{read.table}.

Note the following arguments of \code{read.table} are used by \code{read.columns}
and therefore cannot be set by the user:
\code{header}, \code{col.names}, \code{check.names} and \code{colClasses}.

This function is used by \code{\LinkA{read.maimages}{read.maimages}}.
\end{Details}
\begin{Value}
A data frame (data.frame) containing a representation of the data in the file.
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{read.maimages}{read.maimages}}, \code{\LinkA{read.table}{read.table}}.

An overview of LIMMA functions for reading data is given in \LinkA{03.ReadingData}{03.ReadingData}.
\end{SeeAlso}

