netCorr: Networked correlations.

Description Usage Arguments Value Author(s) Examples

View source: R/netcoin.R

Description

netCorr produces a network object of correlations. Its input has to be at least one set of quantitative variables.

Usage

1
2
3
4
5
6
7
netCorr(variables, weight=NULL, pairwise=FALSE,
        minimum=-Inf, maximum=Inf, sort=FALSE, decreasing=TRUE,
        frequency=FALSE, means=TRUE, 
        method="pearson", criteria="p", Bonferroni=FALSE,
        minL=0, maxL=Inf,
        sortL=NULL, decreasingL=TRUE,
        igraph=FALSE, ...)

Arguments

variables

a data frame with at least two quantitative variables.

weight

a vector of weights. Optimal for data.framed tables

pairwise

Pairwise mode of handling missing values if TRUE. Listwise by default.

minimum

minimum frequency to be considered

maximum

maximum frequency to be considered

sort

sort the correlation matrix according to the frequency of the events

decreasing

decreasing or increasing sort of the matrix

frequency

a logical value true if frequencies are to be shown. Default=FALSE.

means

a logical value true if means are to be shown. Default=TRUE.

method

a vector of statistics of similarity. Pearson correlation by default. spearman and kendall are also possible

criteria

statistic to be use for selection criteria.

Bonferroni

Bonferroni criterium of the signification test.

minL

minimum value of the statistic to include the edge in the list.

maxL

maximum value of the statistic to include the edge in the list.

sortL

sort the list according to the values of a statistic. See below

decreasingL

order in a decreasing way.

igraph

Produces an igraph object instead of a netCoin object if TRUE

...

Any netCoin argument.

Value

The function creates a netCoin object and eventually a folder in the computer with an HTML document named index.html which contains the produced graph. This file can be directly opened with your browser and sent to a web server to work properly.

Author(s)

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

1
2
3
4
5
# A character column (with separator)
data(iris)
netCorr(iris[,1:4],ltext="value",
 main="Correlations between measurements of Iris Species",
 note="Anderson, Edgar (1935) y Fisher, R. A. (1936)") # network object

Example output

Title: Correlations between measurements of Iris Species 

Nodes:
                     name mean  std min max
Sepal.Length Sepal.Length 5.84 0.83 4.3 7.9
Sepal.Width   Sepal.Width 3.06 0.44 2.0 4.4
Petal.Length Petal.Length 3.76 1.77 1.0 6.9
Petal.Width   Petal.Width 1.20 0.76 0.1 2.5

Links:
         source       target     value        z p
3  Sepal.Length Petal.Length 0.8717538 10.67676 0
4  Sepal.Length  Petal.Width 0.8179411 10.01769 0
12 Petal.Length  Petal.Width 0.9628654 11.79264 0

Anderson, Edgar (1935) y Fisher, R. A. (1936)

netCoin documentation built on Oct. 29, 2021, 1:06 a.m.