Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

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.

Value

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

Author(s)

Gordon Smyth

See Also

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


limma

Linear Models for Microarray Data

v3.46.0
GPL (>=2)
Authors
Gordon Smyth [cre,aut], Yifang Hu [ctb], Matthew Ritchie [ctb], Jeremy Silver [ctb], James Wettenhall [ctb], Davis McCarthy [ctb], Di Wu [ctb], Wei Shi [ctb], Belinda Phipson [ctb], Aaron Lun [ctb], Natalie Thorne [ctb], Alicia Oshlack [ctb], Carolyn de Graaf [ctb], Yunshun Chen [ctb], Mette Langaas [ctb], Egil Ferkingstad [ctb], Marcus Davy [ctb], Francois Pepin [ctb], Dongseok Choi [ctb]
Initial release
2020-10-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.