network_rd3 produces a network_rd3 object ready for its representation as an interactive network in a web browser. 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.
network_rd3(nodes = NULL, links = NULL, tree = NULL,
community = NULL, layout = NULL,
name = NULL, label = NULL, group = NULL, groupText = FALSE,
labelSize = NULL, size = NULL, color = NULL, shape = NULL,
border = NULL, legend = NULL, sort = NULL, decreasing = FALSE,
ntext = NULL, info = NULL, image = NULL, imageNames = NULL,
nodeBipolar = FALSE, nodeFilter = NULL, degreeFilter = NULL,
source = NULL, target = NULL,
lwidth = NULL, lweight = NULL, lcolor = NULL, ltext = NULL,
intensity = 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"), roundedItems = FALSE, controls = 1:8,
cex = 1, background = NULL, defaultColor = "#1f77b4",
language = c("en","es","ca"), dir = NULL)This function returns a network_rd3 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.
a data frame with at least one column of node names.
a data frame with at least two columns with source and target node names.
a data frame with two columns: source and target, describing relationships between nodes. It indicates a hierarchy between nodes which can be dynamically explored.
name of the column with names in the nodes data frame.
name of the column with source names in the links data frame.
name of the column with target names in the links data frame.
name of the column with labels in the nodes data frame.
name of the column with groups in the nodes data frame.
show names of the groups.
algorithm to make communities: edge_betweenness("ed"), fast_greedy("fa"), label_prop("la"), leiden_eigen("le"), louvain("lo"), optimal("op"), spinglass("sp"), walktrap("wa")
name of the column with label size in the nodes data frame.
name of the column with size in the nodes data frame.
name of the column with color variable in the nodes data frame.
name of the column with shape variable in the nodes data frame.
name of the column with the variable to represent as a legend in the nodes data frame.
name of the column with html text in the nodes data frame.
name of the column with information to display in a panel in the nodes data frame.
name of the column with border width in the nodes data frame.
name of the column with node order in the nodes data frame (only for heatmap).
decreasing or increasing sort of the nodes (only for heatmap).
name of the column with intensity variable in the links data frame (only for heatmap).
name of the column with width variable in the links data frame.
name of the column with weight variable in the links data frame.
name of the column with color variable in the links data frame.
name of the column with labels in the links data frame.
a character string with a condition for filtering nodes.
a character string with a condition for filtering links.
numeric vector to filter the resulting network by degree. Input can be a number which specifies the minimum degree or two numbers which specify the lower and upper limits of the filter.
a logical value that polarizes negative and positive node values in the graphical representation. Indicates whether the color key should be made symmetric about 0.
a logical value that polarizes negative and positive link values in the graphical representation. Indicates whether the color key should be made symmetric about 0.
a character vector giving a valid html color for node representation.
a percentage for repulsion between nodes.
a percentage for distance of links.
a number between 0.1 and 10 to start displaying zoom.
prevent nodes from being dragged.
a note showing number of scenarios.
upper title of the graph.
lower title of the graph.
a logical value true if barplots representing node attributes frequencies will be added to the final graph.
help text of the graph.
Should the help be shown at the beginning?
background color or image path of the graph.
a matrix with two columns with x/y coordinates or an algorithm to calculate the static layout of the network: 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")
vector indicating the layout limits, must be a numeric vector of length 4 on this order: x_min, y_min, x_max, y_max.
number indicating the amount by which plotting text should be scaled relative to the default.
Display images with rounded borders.
a numeric vector indicating which controls will be shown. 1 = sidebar, 2 = selection buttons, 3 = export buttons, 4 = nodes table, 5 = links table, 6 = search, 7 = zoom, 8 = legend. NULL hide all controls, negative values deny each control and 0 deny all.
a character vector indicating the graph mode allowed: network, heatmap or both (both by default).
a logical value true if the coordinates are to be shown in tables and axes. Default = FALSE.
a logical value true if the directional arrows are to be shown. Default = FALSE.
a logical value true if the legend is to be shown.
a logical value true if the axes are to be shown.
a character vector giving the axes names.
a character string indicating the language of the graph (en=english (default); es=spanish; ca=catalan).
name of the column with the path to node image files in the nodes data frame.
name of the column with names for image files in the nodes data frame which will be shown in the legend.
a "character" string representing the directory where the resulting web files will be saved.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
data(miserables)
net <- network_rd3(miserables$nodes, miserables$links,
size="degree", color="group", lwidth="value")
if (FALSE) {
plot(net)
}
Run the code above in your browser using DataLab