randomSubGraph: Randomly subset the given graph

Description Usage Arguments Value Author(s) Examples

View source: R/graph.R

Description

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

Usage

1
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

1
2
3
4
5
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)

Example output

Attaching package: 'KEGGgraph'

The following object is masked from 'package:graphics':

    plot

NULL

KEGGgraph documentation built on Nov. 8, 2020, 5:42 p.m.