plotnetwork: Plot correlation network (Deprecated)

Description Usage Arguments Details Value Author(s) References Examples

View source: R/plotnetwork.R

Description

Plotting correlation network showing the relationship between each pair of sites connected by segments. The points are arranged in a circle.

Usage

1
2
3
4
5
6
7
8
9
plotnetwork(datainput, n_levels = 6, xlim = c(-2.5, 5),
    ylim = c(-2.5, 2.5), node_size = 3, lwd.var = TRUE,
    lwd = 4, label_dist = 1.2,
    show.node = TRUE, show.text.label = TRUE,
    linecol = c("orange", "blue"),show.legend = TRUE,
    valuename = "r", legendx = 3,
    legendy = -2, legend_line_space = 1,
    legend_linelength = 0.3, adjust_legend_x = 0,
    adjust_legend_y = 0,digits = 2, ... )

Arguments

datainput

The correlation matrix, usually a lower matrix

n_levels

Number of types of segments to show the correlation, note interval should <12

xlim

horizontal range of the canvas

ylim

vertical range of the canvas

node_size

size of the nodes

lwd.var

logical, if the segments width should vary with the absolute value

lwd

width of the segments for connecting the sites, default 1

label_dist

Distance of text labels from each node.

show.node

Whether the nodes in the figure should be labeled

show.text.label

Whether the text label should be drawn.

linecol

Colours showing positve or negative correlation. The lines representing positive correlations use the first element

show.legend

If the legend should be shown

valuename

Name of the variable shown in the legend

legendx

the starting position of the legend x

legendy

the starting position of the legend y

legend_line_space

the space between the lines in the legend

legend_linelength

length of the segment in the legend

adjust_legend_x

adjusting the position of legend (x)

adjust_legend_y

adjusting the position of legend (y)

digits

Number of disgits shown in the legend, it will be used in generating the breaks as well

...

other parameters related with plot.default

Details

This function could be used to plot the pairwise connections between less than 20 sites ( above 20 is not recommended since there would be too many connections).

The lines will be in orange or blue, according the sign of the value.

Value

Correlation network plots.

Author(s)

Jinlong Zhang jinlongzhang01@gmail.com

References

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(testdata)
spmatrix <- data2mat(testdata)
result <- sp.pair(spmatrix)
plotnetwork(result$Pearson)

plotnetwork(result$Pearson, linecol = c("red", "black"))

plotnetwork(result$Pearson, n_levels = 4,  node_size = 4,  
    lwd.var = FALSE, label_dist = 0.8, show.node = FALSE, 
    show.text.label = FALSE, linecol = c("red", "black"), 
    show.legend = TRUE, valuename = "r", legendx = 3, 
    legend_line_space = 0.5, legend_linelength = 0.5, 
    adjust_legend_x = -1)

title("Pearson Correlation Network")

helixcn/spaa documentation built on Aug. 13, 2021, 3:21 a.m.