Learn R Programming

pamr (version 1.25)

pamr.from.excel: A function to read in a text file saved from Excel

Description

A function to read in a text file saved from Excel. The spreadsheet is assumed to be of the format used by the SAM program.

Usage

pamr.from.excel(file, ncols, sample.labels = FALSE, batch.labels = FALSE)

Arguments

file
Character name of a text file. This is assumed to be a tab-delimited text file saved from an excel spreadsheet from "SAM". The spreadsheet has one row of expression values per gene. In addition there is one information row and two information co
ncols
Number of columns in file
sample.labels
Optional argument. If true, "file" is assumed to have an additional row at the top, consisting of two blank cells followed by a sample labels for each of the columns. If available, these sample labels are used by various plotting routines.
batch.labels
Optional argument. If true, "file" is assumed to have an additional row at the top, consisting of two blank cells followed by a batch labels for each of the columns. If sample.labels=T as well, the row of batch labels are assumed to come

Value

  • A list with components
  • x
  • {the matrix of expression values}
  • y
  • {a vector of class labels for each sample,}
  • geneid
  • {a vector of gene identifiers}
  • genenamesa vector of gene names
  • samplelabelsa vector of sample labels, if provided in "file"
  • batchlabelsa vector of batch labels, if provided in "file"

Details

pamr.from.excel {Reads in the text file "file", and creates an object with components x (the matrix of expression values), y- a vector of class labels for each sample, geneid- a vector of gene identifiers and genenames- a vector of gene names}