Learn R Programming

spaa (version 0.2.2)

plotnetwork: Correlation network plot

Description

This function could be used to plot correlation network, with less than 15 sites (recommended). The points lie in a circle with lines connected. Blue lines indicate negative values and the red ones the positive ones.

Usage

plotnetwork(datainput, interval = 8, xlim = c(-2.5,5), ylim=c(-3.2,3.2), lty = c(1,2,3,4,4,3,2,1,5), value = "r", legendx = 3, legendy = 0, right = 1.2, intcept = 0.22, left = 0.35, linelength = 0.3, cex = 3, lwd = 1.5, show.legend = TRUE, digits = 2, dit = 1.2, number.label = TRUE, text.label = TRUE, linecol = c("red", "black"), ...)

Arguments

datainput
The correlation matrix, ex. Pearson's correlation matrix
interval
Number of intervals of the values, indicating how to partition the range of input data
xlim
The x range of the plot. The users need not to change it.
ylim
The y range of the plot. The users need not to change it.
lty
Line styles used in connection lines for each interval. Must have number of elements + 1.
value
Value of the matrix, should be a character, will used in legend.
legendx
Legend position x.
legendy
Legend position y.
right
Legend position adjustment parameter.
intcept
Legend position adjustment. can be used to specify the row space between each line for the legend.
left
Legend position adjustment parameter.
linelength
Line length in the legend.
cex
Point size for each circle.
lwd
Line width for each circle.
...
Other arguments to be passed from.
show.legend
Whether the legend should be drawn.
digits
Number of digits displayed in legend.
dit
Distance of text labels from each corner.
number.label
Whether the number label should be drawn.
text.label
Whether the text label should be drawn.
linecol
Colours of the lines specified. The positive correlation will be drawn in the first colour specified.

Value

Correlation network plots.

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 red or blue, according the sign of the value of association. Users can adjust the line style and legends based on their requirements.

References

None

Examples

Run this code
data(testdata)
spmatrix <- data2mat(testdata)
result <- sp.pair(spmatrix)
plotnetwork(result$Pearson)

plotnetwork(result$Pearson, linecol = c("orange", "blue"),
number.label = FALSE)

title("Pearson Correlation Network")

Run the code above in your browser using DataLab