randomSubGraph {KEGGgraph} | R 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)

[Package KEGGgraph version 1.40.0 Index]