countElements: Number of elements in aspect

Description Usage Arguments Details Value See Also Examples

View source: R/AspectDependencies.R

Description

This function returns the number of elements in an aspect.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

1
2
3
4
5
6
7
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 Oct. 26, 2021, 1:33 a.m.