countElements: Number of elements in aspect

View source: R/AspectDependencies.R

countElementsR Documentation

Number of elements in aspect

Description

This function returns the number of elements in an aspect.

Usage

countElements(x)

## Default S3 method:
countElements(x)

## S3 method for class 'RCX'
countElements(x)

## S3 method for class 'CyVisualPropertiesAspect'
countElements(x)

## S3 method for class 'MetaDataAspect'
countElements(x)

Arguments

x

an object of one of the aspect classes (e.g. Nodes) or RCX class.

Details

Uses method dispatch, so the default methods already returns the correct number for the most aspect classes. This way it is easier to extend the data model.

There are only two exceptions in the core and Cytoscape aspects: Meta-data and CyVisualProperties.

Meta-data is a meta-aspect and therefore not included in Meta-data, and so its return is NA.

CyVisualProperties is the only aspect with a complex data structure beneath. Therefore its number of elements is just the number of how many of the following properties are set: network, nodes, edges, defaultNodes or defaultEdges.

Value

integer; number of elements. For RCX objects all counts are returned in the vector named by the aspect class.

See Also

hasIds(), idProperty(), refersTo(), referredBy(), maxId()

Examples

nodes = createNodes(name = c("ĆDK1","CDK2","CDK3"))
edges = createEdges(source = c(0,0), target = c(1,2))
rcx = createRCX(nodes = nodes, edges = edges)

countElements(nodes)

countElements(rcx)

frankkramer-lab/RCX documentation built on Feb. 4, 2023, 5:12 p.m.