MyNixOS website logo
Description

Bivariate Correlations Calculation and Visualization.

Compute and visualize using the 'visNetwork' package all the bivariate correlations of a dataframe. Several and different types of correlation coefficients (Pearson's r, Spearman's rho, Kendall's tau, distance correlation, maximal information coefficient and equal-freq discretization-based maximal normalized mutual information) are used according to the variable couple type (quantitative vs categorical, quantitative vs quantitative, categorical vs categorical).

linkspotter

Linkspotter is a package of the R software that mainly allows to calculate and visualize using a graph all the bivariate links of a dataset.

Its main features are:

  • Calculation of several correlation matrices corresponding to different link coefficients
  • Clustering of variables using an unsupervised learning
  • Supervised discretization of one or a couple of variables.

It also offers a customizable user interface, allowing to:

  • visualize the links using a graph (the variables correspond to the nodes and the links correspond to the edges)
  • show the distribution of each variable using its histogram or barplot
  • visualize a link between a couple of variables using scatter plots, box plots, etc.

Available link coefficients are:

Installation

install.packages("linkspotter")

current development version from GitHub:

library(devtools)
install_github("sambaala/linkspotter")

Usage

Load the package:

library(linkspotter)

Have a look at the documentation:

help(package="linkspotter")

The examples are carried out using 'iris' data.

Calculate the MaxNMI between two variables

maxNMI(iris$Sepal.Length,iris$Petal.Length)

Calculate all link coefficients for all variable couples

corCouples<-multiBivariateCorrelation(iris)
print(corCouples)

Extract a correlation matrix from the correlation dataframe

The Pearson correlation matrix:

corMatrixPearson<-corCouplesToMatrix(x1_x2_val = corCouples[,c('X1','X2',"pearson")])
print(corMatrixPearson)

The MaxNMI matrix:

corMatrixMaxNMI<-corCouplesToMatrix(x1_x2_val = corCouples[,c('X1','X2',"MaxNMI")])
print(corMatrixMaxNMI)

Clustering of variables using a correlation matrix

cl<-clusterVariables(corMatrix = corMatrixMaxNMI)
print(cl)

Visualize the graph using Pearson correlation

linkspotterGraph(corDF = corCouples, variablesClustering = cl, 
  corMethod = "pearson", minCor = 0.25, smoothEdges = FALSE, 
  dynamicNodes = FALSE)

Visualize the graph using MaxNMI

linkspotterGraph(corDF = corCouples, variablesClustering = cl, 
  corMethod = "MaxNMI", minCor = 0.25, smoothEdges = F, 
  dynamicNodes = TRUE)

Launch the customizable user interface

linkspotterUI(dataset = iris, corDF = corCouples, 
  variablesClustering = cl, appTitle = "Linkspotter example")

Additional features

Complete Linkspotter computation:

lsiris<-linkspotterComplete(iris)

Complete Linkspotter computation from an external file:

lsiris<-linkspotterOnFile("iris.csv")
summary(lsiris)
summary(lsiris)

Then launch the user interface (linkspotter shiny app) on port 8000 for example:

lsiris$launchShiny(options=list(port=8000))

Help:

help(linkspotterComplete)

User interface guide

'Graphs' tab

The graph

The variables correspond to the nodes and their links correspond to the edges. Node color depends on the clustering. Edge color depends on the correlation direction quantitative couples (blue: positive correlation, red: negative correlation).

First features

  • Correlation coefficient drop-down list : allows to choose the link coefficient to be visualized.
  • Minimum Correlation cursor: allows to define the minimum link measurement (from 0 to 1) threshold necessary to plot a edge.
  • Interest variable drop-down list: allows to choose a variable of interest. If a variable of interest is selected, a new cursor named Minimum Correlation with interest variable appears. It gives the possibility of defining a new minimum threshold of correlation specific to this variable of interest, in addition to the general threshold. The upper limit of this specific threshold is the global threshold.

Checkboxes

  • Highlight variable on click: if checked, it is possible to focus on a node, by clicking on it or by selecting it from the drop-down list that appears.
  • Variable Clustering: If checked, the nodes are colored according to the group to which they belong. If it is not checked, all nodes are blue.
  • Color Edges by correlation direction: if checked, the edges are colored according to the direction of the correlation (blue for a positive correlation, red for a negative correlation and gray for NA) found between the two variables. The NA case corresponds to when at least one of the two variables is qualitative.
  • Smooth edges: if checked, edges are allowed to bend as needed. Otherwise, they remain straight.
  • Dynamic nodes stabilization: if checked, the graph is repositioned according to the graph stabilization algorithm after each movement by the user.
  • Re-stabilize: button that allows to re-stabilize the graph (centering and redistribution of the nodes on plane in "almost optimal" way)

General information

  • nb. observations: the number of entries in the dataset
  • nb. variables: the number of variables in the dataset
  • nb. couples: the number of couples
  • nb. current edges: the current number of edges plotted according to the chosen thresholds

Click on a graph link

It produces the following:

Link summary figure (bottom right of the graph)

Its type depends on the nature of the corresponding link:

  • Quantitative variable vs quantitative variable: a point cloud
  • Variable quantitative vs qualitative variable: a boxplot
  • Qualitative variable vs qualitative variable: not yet treated

Link summary table (under general information)

It displays all the measurements calculated for the link corresponding to the clicked edge. When at least one of the variables is qualitative, only the MaxNMI has a value.

Click on a node of the graph

It produces the following:

A summary figure for the corresponding variable (bottom left of the graph)

Its type depends on the nature of the corresponding variable:

  • Quantitative variable: a histogram
  • Qualitative variable: a bar graph

A summary table for the corresponding variable (under general information)

Its type depends on the nature of the variable:

  • Quantitative variable: a table containing the min, 1st quartile, median, mean, 3rd quartile and max of the variable.
  • Qualitative variable: a table containing the frequency of each modality of the variable.

'Tables' tab

This tab displays 2 tables:

  • A correlation matrix corresponding to the selected correlation coefficient
  • A table indicating the group which each variable is assigned to after by the clustering.

The Correlation coefficient option allows you to choose the coefficient of correlation to be considered among those calculated initially.

Importations

Linkspotter uses and combine features coming from several other R packages, namely 'infotheo', 'minerva', 'energy', 'mclust', 'shiny', 'shinybusy', 'visNetwork', 'rAmCharts' and 'ggplot2'.

Metadata

Version

1.3.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows