xMarkNet | R Documentation

## Function to mark a network within another network

### Description

`xMarkNet` is supposed to mark a network within another network.

### Usage

    xMarkNet(ig1, ig2, verbose = TRUE)

### Arguments

`ig1` | a "igraph" object within which the mark happens
`ig2` | a "igraph" object to be marked. Only overlapped nodes and edges are marked
`verbose` | logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display

### Value

an object of class "igraph" appended with a node attribute 'mark' (0 for the background, 1 for the marked) and an edge attribute 'mark' (0 for the background, 1 for the marked)

### Note

none

### See Also

`xMarkNet`

### Examples

    ## Not run:
    # Load the library
    library(XGR)

    ## End(Not run)

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
    ## Not run:
    ig1 <- xDefineNet(network="KEGG_environmental",
    RData.location=RData.location)
    ig2 <- xDefineNet(network="KEGG_organismal",
    RData.location=RData.location)
    ig <- xMarkNet(ig1, ig2)

    E(ig)$color <- ifelse(E(ig)$mark==0, 'lightblue1', 'darkgreen')
    E(ig)$color.alpha <- ifelse(E(ig)$mark==0, 0.3, 0.7)
    ig <- ig %>% xLayout("gplot.layout.fruchtermanreingold")
    gp <- xGGnetwork(ig, node.xcoord='xcoord', node.ycoord='ycoord',
    node.color="mark", colormap="orange-darkgreen", node.color.alpha=0.7,
    edge.color="color", edge.color.alpha="color.alpha", edge.arrow.gap=0) +
    theme(legend.position='none')

    ## End(Not run)