Rnet_Heatmap: Rnet_Heatmap - Function to generate a bitmap figure to...

Description Usage Arguments Value This function does *not* plot the heatmap; The object should be plotted using the associated method image.edge_heatmap(). Examples

View source: R/Rnet_heatmap.r

Description

bitmap can be used to show how edges in a network change over time or other criteria. This function takes an object of the 'rnetStrata' class, specifically @E_aggr, and returns a numerical matrix used to visualize E_matrix. The numerical matrix can be visualized with a call to the 'image' function; The assinged colors are stored in the 'palette' attribute attached to the matrix. This matrix can then be used to plot the bitmap in which each horizontal row in the bitmap represents a unique edge found in the set of networks in rnet.multi.strata object and each vertical column is a network stratum (see the 'Rnet' method for more information). The colors represent the binned penalized partial correlation estimates in the E_aggr.

Usage

1
2
3
Rnet_Heatmap(x, e_cuts, sort_mat = NULL, pos_col = c("#FFBBBB",
  "#FF8888", "#FF4444", "#FF0000"), neg_col = c("#BBFFBB", "#88FF88",
  "#44FF44", "#00FF00"), zero_col = "#FFFFFF", NA_col = "#CCCCCC")

Arguments

x

An object of class 'rnetStrata'; Object containing the edges to be plotted in heatmap.

e_cuts

numeric vector; used to cut the edge attribute values in x@E_aggr. Note binning of negative values is based on absolute value, making the categories symmetric around 0.

sort_mat

character; indicates whether the matrix should be sorted by rows (strata names) or columns (edge names). Partial matches to 'rows' or 'columns'. No sorting will occur if NULL or no partial match found.

pos_col

A vector of colors corresponding to the binned positive x@E_aggr values. Defaults to 4 shades of red.

neg_col

A vector of colors corresponding to the binned negative x@E_aggr values. Defaults to 4 shades of green.

zero_col

A single value for coloring edges with value = 0 (typically corresponds to an absent edge).

NA_col

A single value for color invalid edges. Edges will typically be found to be in valid if one or both incident vertices were missing in some strata or insufficient observations were available to estimate an edge in a stratum (see the 'n_threshold' argument in the method 'Rnet'). The length of pos_col and neg_col must be the same and must be of length 1 greater than e_cuts.

Value

a S3 object of class 'edge_heatmap' that includes an attribute ('palatte') with the assigned colors.

This function does *not* plot the heatmap; The object should be plotted using the associated method image.edge_heatmap().

NA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Example using EC_Rnets_byYear
EC_Rnets_byYear <- Rnet(x = NARMS_EC_DATA, 
						L1 = 0.25, 
						vert = c('AMP', 'AMC', 'AXO', 'TIO', 'NAL', 
						  'CIP', 'STR', 'GEN', 'COT', 'FIS', 'AZI'), 
						n_min = 20,
					subset = 'Year'
						)

EC_Heatmap <- Rnet_Heatmap(EC_Rnets_byYear, e_cuts = c(0, 0.05, 0.1, 0.2, 1))

par(mar = c(4, 5, 1, 1)+0.1)
image(EC_Heatmap)

Rnets documentation built on July 23, 2019, 9:04 a.m.