Last data update: 2014.03.03

R: Retrieve the Dimensions of an RGList, MAList or MArrayLM...
dimR Documentation

Retrieve the Dimensions of an RGList, MAList or MArrayLM Object

Description

Retrieve the number of rows (genes) and columns (arrays) for an RGList, MAList or MArrayLM object.

Usage

## S3 method for class 'RGList'
dim(x)
## S3 method for class 'RGList'
length(x)

Arguments

x

an object of class RGList, MAList or MArrayLM

Details

Microarray data objects share many analogies with ordinary matrices in which the rows correspond to spots or genes and the columns to arrays. These methods allow one to extract the size of microarray data objects in the same way that one would do for ordinary matrices.

A consequence is that row and column commands nrow(x), ncol(x) and so on also work.

Value

Numeric vector of length 2. The first element is the number of rows (genes) and the second is the number of columns (arrays).

Author(s)

Gordon Smyth

See Also

dim in the base package.

02.Classes gives an overview of data classes used in LIMMA.

Examples

M <- A <- matrix(11:14,4,2)
rownames(M) <- rownames(A) <- c("a","b","c","d")
colnames(M) <- colnames(A) <- c("A1","A2")
MA <- new("MAList",list(M=M,A=A))
dim(M)
ncol(M)
nrow(M)
length(M)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(limma)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/limma/dim.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dim
> ### Title: Retrieve the Dimensions of an RGList, MAList or MArrayLM Object
> ### Aliases: dim.RGList dim.MAList dim.EListRaw dim.EList dim.MArrayLM
> ###   length.RGList length.MAList length.EListRaw length.EList
> ###   length.MArrayLM
> ### Keywords: array
> 
> ### ** Examples
> 
> M <- A <- matrix(11:14,4,2)
> rownames(M) <- rownames(A) <- c("a","b","c","d")
> colnames(M) <- colnames(A) <- c("A1","A2")
> MA <- new("MAList",list(M=M,A=A))
> dim(M)
[1] 4 2
> ncol(M)
[1] 2
> nrow(M)
[1] 4
> length(M)
[1] 8
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>