row+colnames {BiocGenerics}R Documentation

Row and column names

Description

Get or set the row or column names of a matrix-like object.

NOTE: This man page is for the rownames, `rownames<-`, colnames, and `colnames<-` S4 generic functions defined in the BiocGenerics package. See ?base::rownames for the default methods (defined in the base package). Bioconductor packages can define specific methods for objects (typically matrix-like) not supported by the default methods.

Usage

rownames(x, do.NULL=TRUE, prefix="row")
rownames(x) <- value

colnames(x, do.NULL=TRUE, prefix="col")
colnames(x) <- value

Arguments

x

A matrix-like object.

do.NULL, prefix

See ?base::rownames for a description of these arguments.

value

Either NULL or a character vector equal of length equal to the appropriate dimension.

Value

The getters will return NULL or a character vector of length nrow(x) for rownames and length ncol(x) for colnames(x).

See ?base::rownames for more information about the default methods, including how the setters are expected to behave.

Specific methods defined in Bioconductor packages should behave as consistently as possible with the default methods.

See Also

Examples

## rownames getter:
rownames  # note the dispatch on the 'x' arg only
showMethods("rownames")
selectMethod("rownames", "ANY")  # the default method

## rownames setter:
`rownames<-`
showMethods("rownames<-")
selectMethod("rownames<-", "ANY")  # the default method

## colnames getter:
colnames  # note the dispatch on the 'x' arg only
showMethods("colnames")
selectMethod("colnames", "ANY")  # the default method

## colnames setter:
`colnames<-`
showMethods("colnames<-")
selectMethod("colnames<-", "ANY")  # the default method

[Package BiocGenerics version 0.24.0 Index]