Learn R Programming

eaf (version 1.0)

read.data.sets: Read several data.frame sets

Description

Reads a text file in table format and creates a data frame from it. The file may contain several sets, separated by empty lines. The function adds an additional column set to indicate to which set each row belongs.

Usage

read.data.sets(file, col.names)

Arguments

file
the name of the file which the data are to be read from. Each row of the table appears as one line of the file. If it does not contain an absolute path, the file name is relative to the current working directory, getwd
col.names
a vector of optional names for the variables. The default is to use "V" followed by the column number.

Value

  • A data frame (data.frame) containing a representation of the data in the file. An extra column set is added to indicate to which set each row belongs.

See Also

read.table, eafplot, eafdiffplot

Examples

Run this code
A1<-read.data.sets(file.path(system.file(package="eaf"),"extdata","ALG_1_dat"))
str(A1)
A2<-read.data.sets(file.path(system.file(package="eaf"),"extdata","ALG_2_dat"))
str(A2)

Run the code above in your browser using DataLab