Definition for S4 class InfoDataFrame

Description

InfoDataFrame has two slots: data and dimLabels.

Value

Class InfoDataFrame

Slots

dataA data.frame containing terms (rows) and measured variables (columns).

dimLabelsA character descripting labels for rows and columns.

Creation

An object of this class can be created via: new("InfoDataFrame", data, dimLabels)

Methods

Class-specific methods:

  • dim(): retrieve the dimension in the object
  • nrow(): retrieve number of rows in the object
  • ncol(): retrieve number of columns in the object
  • rowNames(): retrieve names of rows in the object
  • colNames(): retrieve names of columns in the object
  • dimLabels(): retrieve the slot 'dimLabels', containing labels used for display of rows and columns in the object
  • Data(): retrieve the slot 'data' in the object

Standard generic methods:

  • str(): compact display of the content in the object
  • show(): abbreviated display of the object
  • as(data.frame, "InfoDataFrame"): convert a data.frame to an object of class InfoDataFrame
  • [i,j]: get the subset of the same class

Access

Ways to access information on this class:

  • showClass("InfoDataFrame"): show the class definition
  • showMethods(classes="InfoDataFrame"): show the method definition upon this class
  • getSlots("InfoDataFrame"): get the name and class of each slot in this class
  • slotNames("InfoDataFrame"): get the name of each slot in this class
  • selectMethod(f, signature="InfoDataFrame"): retrieve the definition code for the method 'f' defined in this class

Examples

# generate data on domain information on data <- data.frame(x=1:10, y=I(LETTERS[1:10]), row.names=paste("Domain", 1:10, sep="_")) dimLabels <- c("rowLabels", "colLabels") # create an object of class InfoDataFrame x <- new("InfoDataFrame", data=data, dimLabels=dimLabels) x
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 ... Domain_9 Domain_10 (10 total) colNames: x y
# alternatively, using coerce methods x <- as(data, "InfoDataFrame") x
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 ... Domain_9 Domain_10 (10 total) colNames: x y
# look at various methods defined on class Anno dimLabels(x)
[1] "rowLabels" "colLabels"
dim(x)
[1] 10 2
nrow(x)
[1] 10
ncol(x)
[1] 2
rowNames(x)
[1] "Domain_1" "Domain_2" "Domain_3" "Domain_4" "Domain_5" "Domain_6" [7] "Domain_7" "Domain_8" "Domain_9" "Domain_10"
colNames(x)
[1] "x" "y"
Data(x)
x y Domain_1 1 A Domain_2 2 B Domain_3 3 C Domain_4 4 D Domain_5 5 E Domain_6 6 F Domain_7 7 G Domain_8 8 H Domain_9 9 I Domain_10 10 J
x[1:3,]
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 colNames: x y