nrow: The number of rows/columns of an array-like object

Description Usage Arguments Value See Also Examples

Description

Return the number of rows or columns present in an array-like object.

NOTE: This man page is for the nrow, ncol, NROW and NCOL S4 generic functions defined in the BiocGenerics package. See ?base::nrow for the default methods (defined in the base package). Bioconductor packages can define specific methods for objects (typically matrix- or array-like) not supported by the default methods.

Usage

1
2
3
4
nrow(x)
ncol(x)
NROW(x)
NCOL(x)

Arguments

x

A matrix- or array-like object.

Value

A single integer or NULL.

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

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
nrow
showMethods("nrow")
selectMethod("nrow", "ANY")  # the default method

ncol
showMethods("ncol")
selectMethod("ncol", "ANY")  # the default method

NROW
showMethods("NROW")
selectMethod("NROW", "ANY")  # the default method

NCOL
showMethods("NCOL")
selectMethod("NCOL", "ANY")  # the default method

Example output

Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

standardGeneric for "nrow" defined from package "base"

function (x) 
standardGeneric("nrow")
<environment: 0x559eebad3830>
Methods may be defined for arguments: x
Use  showMethods("nrow")  for currently available ones.
Function: nrow (package base)
x="ANY"

Method Definition (Class "derivedDefaultMethod"):

function (x) 
dim(x)[1L]
<bytecode: 0x559eebb0d980>
<environment: namespace:base>

Signatures:
        x    
target  "ANY"
defined "ANY"
standardGeneric for "ncol" defined from package "base"

function (x) 
standardGeneric("ncol")
<environment: 0x559eeaaeda40>
Methods may be defined for arguments: x
Use  showMethods("ncol")  for currently available ones.
Function: ncol (package base)
x="ANY"

Method Definition (Class "derivedDefaultMethod"):

function (x) 
dim(x)[2L]
<bytecode: 0x559eeb9bb580>
<environment: namespace:base>

Signatures:
        x    
target  "ANY"
defined "ANY"
standardGeneric for "NROW" defined from package "base"

function (x) 
standardGeneric("NROW")
<environment: 0x559eebb48170>
Methods may be defined for arguments: x
Use  showMethods("NROW")  for currently available ones.
Function: NROW (package base)
x="ANY"

Method Definition (Class "derivedDefaultMethod"):

function (x) 
if (length(d <- dim(x))) d[1L] else length(x)
<bytecode: 0x559eebb804a0>
<environment: namespace:base>

Signatures:
        x    
target  "ANY"
defined "ANY"
standardGeneric for "NCOL" defined from package "base"

function (x) 
standardGeneric("NCOL")
<environment: 0x559eeb9ff6a8>
Methods may be defined for arguments: x
Use  showMethods("NCOL")  for currently available ones.
Function: NCOL (package base)
x="ANY"

Method Definition (Class "derivedDefaultMethod"):

function (x) 
if (length(d <- dim(x)) > 1L) d[2L] else 1L
<bytecode: 0x559eeba841c0>
<environment: namespace:base>

Signatures:
        x    
target  "ANY"
defined "ANY"

BiocGenerics documentation built on April 17, 2021, 6:01 p.m.