netCoin produces a netCoin object of coincidences. Its input has to be two data.frames: one of attributes of events or nodes, and the other of attributes of the edges or links.

netCoin(nodes = NULL, links = NULL, tree = NULL,
        community = NULL, layout = NULL,
        name = NULL, label = NULL, group = NULL, labelSize = NULL,
        size = NULL, color = NULL, shape = NULL, legend = NULL,
        orderA = NULL, orderD = NULL, ntext = NULL, info = NULL,
        image = NULL, imageNames = NULL,
        nodeBipolar = FALSE, nodeFilter = NULL, degreeFilter = NULL,
        lwidth = NULL, lweight = NULL, lcolor = NULL, ltext = NULL,
        linkBipolar = FALSE, linkFilter = NULL,
        repulsion = 25, distance = 10, zoom = 1,
        fixed = showCoordinates, limits = NULL,
        main = NULL, note = NULL, showCoordinates = FALSE, showArrows = FALSE,
        showLegend = TRUE, frequencies = FALSE, showAxes = FALSE,
        axesLabels = NULL, scenarios = NULL, help = NULL, helpOn = FALSE,
        mode = c("network","heatmap"), controls = 1:4, cex = 1,
        background = NULL, defaultColor = "#1f77b4",
        language = c("en","es","ca"), dir = NULL)

Arguments

nodes

a data frame with at least one vector of names.

links

a data frame with at least two vectors with source and target, including names of nodes.

tree

a data frame with two vectors: source and target, describing relationships between nodes.

name

name of the vector with names in the nodes data frame. By default, if language="en", name is "name".

label

name of the vector with labels in the nodes data frame.

group

name of the vector with groups in the nodes data frame.

community

algorithm to make communities: edge_betweenness("ed"), fast_greedy("fa"), label_prop("la"), leiden_eigen("le"), louvain("lo"), optimal("op"), spinglass("sp"), walktrap("wa")

labelSize

name of the vector with label size in the nodes data frame.

size

name of the vector with size in the nodes data frame.

color

name of the vector with color variable in the nodes data frame.

shape

name of the vector with shape variable in the nodes data frame.

legend

name of the vector with the variable to represent as a legend in the nodes data frame.

ntext

name of the vector with html text in the nodes data frame.

info

name of the vector with information to display in a panel in the nodes data frame.

orderA

name of the vector with node ascending order in the nodes data frame.

orderD

name of the vector with node descending order in the nodes data frame.

lwidth

name of the vector with width variable in the links data frame.

lweight

name of the vector with weight variable in the links data frame.

lcolor

name of the vector with color variable in the links data frame.

ltext

name of the vector with labels in the links data frame.

nodeFilter

condition for filtering nodes.

linkFilter

condition for filtering links.

degreeFilter

numeric vector to filter the resulting network by degree.

nodeBipolar

a logical value that polarizes negative and positive node values in the graphical representation. Default = FALSE.

linkBipolar

a logical value that polarizes negative and positive link values in the graphical representation. Default = FALSE.

defaultColor

a character vector giving a valid html color.

repulsion

a percentage for repulsion between nodes.

distance

a percentage for distance of links.

zoom

a number between 0.1 and 10 to start displaying zoom.

fixed

prevent nodes from being dragged.

scenarios

a note showing number of scenarios.

main

upper title of the graph.

note

lower title of the graph.

frequencies

a logical value true if the frequencies can be shown in barplots. Default = FALSE.

help

help text of the graph.

helpOn

Should the help be shown at the beginning?

background

background color or image of the graph.

layout

a matrix with two columns or an algorithm to elaborate the coordinates: davidson.harel drl("da"), circle("ci"), Force-Atlas-2("fo"), fruchterman.reingold("fr"), gem("ge"), grid("gr"), kamada.kawai("ka"), lgl("lg"), mds("md"), random("ra"), reingold.tilford("re"), star("sta"), sugiyama("sug")

limits

vector indicating size references to display layout, must be a numeric vector of length 4: x1, y1, x2, y2.

cex

number indicating the amount by which plotting text should be scaled relative to the default. Default = 1.

controls

a numeric vector indicating which controls will be shown. 1 = sidebar, 2 = selection buttons, 3 = tables, 4 = export buttons. NULL hide all controls, negative values deny each control and 0 deny all.

mode

a character vector indicating the graph mode allowed: network, heatmap or both (both by default).

showCoordinates

a logical value true if the coordinates are to be shown in tables and axes. Default = FALSE.

showArrows

a logical value true if the directional arrows are to be shown. Default = FALSE.

showLegend

a logical value true if the legend is to be shown. Default = TRUE.

showAxes

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

axesLabels

a character vector giving the axes names.

language

a character vector (es=spanish; en=english; ca=catalan).

image

name of the vector with image files in the nodes data frame.

imageNames

name of the vector with names for image files in the nodes data frame.

dir

a "character" string representing the directory where the web files will be saved.

Value

This function returns a netCoin object. If the 'dir' attribute is specified, the function creates 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.

Note

nodes and links arguments can be substituted by a netCoin object to add or change options to it.

References

Escobar, M. and Martinez-Uribe, L. (2020) Network Coincidence Analysis: The netCoin R Package. Journal of Statistical Software, 93, 1-32. doi: 10.18637/jss.v093.i11 .

Author

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

Examples

# A character column (with separator) frame <- data.frame(A = c("Man; Women", "Women; Women", "Man; Man", "Undet.; Women; Man")) data <- dichotomize(frame, "A", sep = "; ")[2:4] C <- coin(data) # coincidence matrix N <- asNodes(C) # node data frame E <- edgeList(C) # edge data frame netCoin(N, E) # netCoin object
#> #> Nodes(3): #> name frequency #> Man 3 #> Women 3 #> Undet. 1 #> #> Links(2): #> Source Target Haberman p(Z) #> Man Undet. 0.6666667 0.2707349 #> Women Undet. 0.6666667 0.2707349 #>