Learn R Programming

limma (version 3.28.14)

read.columns: Read specified columns from a file

Description

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.

Usage

read.columns(file, required.col=NULL, text.to.search="", sep="\t", quote="\"", skip=0, fill=TRUE, blank.lines.skip=TRUE, comment.char="", allowEscapes=FALSE, ...)

Arguments

file
the name of the file which the data are to be read from.
required.col
character vector of names of the required columns
text.to.search
character string. If any column names can be found in this string, those columns will also be read.
sep
the field separator character
quote
character string of characters to be treated as quote marks
skip
the number of lines of the data file to skip before beginning to read data.
fill
logical: if TRUE then in case the rows have unequal length, blank fields are implicitly added.
blank.lines.skip
logical: if TRUE blank lines in the input are ignored.
comment.char
character: a character vector of length one containing a single character or an empty string.
allowEscapes
logical. Should C-style escapes such as \n be processed or read verbatim (the default)?
...
other arguments are passed to read.table, excluding the following which are reserved and cannot be set by the user: header, col.names, check.names and colClasses.

Value

A data frame (data.frame) containing a representation of the data in the file.

Details

This function is an interface to read.table in the base package. It uses required.col and text.to.search to set up the colClasses argument of read.table.

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

This function is used by read.maimages.

See Also

read.maimages, read.table.

An overview of LIMMA functions for reading data is given in 03.ReadingData.