Learn R Programming

KEGGgraph (version 1.30.0)

randomSubGraph: 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

Examples

Run this code
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)

Run the code above in your browser using DataLab