randomSubGraph: Randomly subset the given graph

View source: R/graph.R

randomSubGraphR Documentation

Randomly subset the given graph

Description

The function is intended to be a test tool. It subset the given graph repeatedly.

Usage

randomSubGraph(graph, per = 0.25, N = 10)

Arguments

graph

A graph object

per

numeric, the percentage of the nodes to be sampled, value between (0,1)

N

Repeat times

Value

The function is called for its side effect, NULL is returned

Author(s)

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

tnodes <- c("Hamburg","Dortmund","Bremen", "Paris")
tedges <- list("Hamburg"=c("Dortmund", "Bremen"),
"Dortmund"=c("Hamburg"), "Bremen"=c("Hamburg"), "Paris"=c())
tgraph <- new("graphNEL", nodes = tnodes, edgeL = tedges)
randomSubGraph(tgraph, 0.5, 10)

Accio/KEGGgraph documentation built on Jan. 13, 2023, 1:03 p.m.