                                  Package ‘rD3plot’
                                            March 22, 2023
Type Package
Version 1.0.68
Date 2023-03-21
Title Interactive Networks, Timelines, Barplots, Galleries with
      'D3.js'
Description
      Creates interactive analytic graphs with 'R'. It joins the data analysis power of R and the visual-
      ization libraries of JavaScript in one package. The package provides interactive networks, time-
      lines, barplots, image galleries and evolving networks. Graphs are repre-
      sented as 'D3.js' graphs embedded in a web page ready for its interactive analysis and exploration.
License GPL-2 | GPL-3
Depends R (>= 3.5.0)
Imports igraph (>= 1.0.1)
Suggests shiny, evolMap
NeedsCompilation no
Maintainer Modesto Escobar <modesto@usal.es>
Encoding UTF-8
Author Modesto Escobar [aut, cph, cre]
        (<https://orcid.org/0000-0003-2072-6071>),
      Carlos Prieto [aut] (<https://orcid.org/0000-0001-8178-9768>),
      David Barrios [aut]
Repository CRAN
Date/Publication 2023-03-22 16:50:10 UTC
R topics documented:
          rD3plot-package     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
          add_tutorial_rd3 .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
          barplot_rd3 . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
          evolNetwork_rd3     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
          finches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
                                                      1
2                                                                                            add_tutorial_rd3
          galapagos . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . .  7
          gallery_rd3 . . . .   . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . .  7
          miserables . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . .  9
          network_rd3 . . . .   . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 10
          pie_rd3 . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 13
          rd3_addDescription    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 14
          rd3_addImage . . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 15
          rd3_fromIgraph . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 16
          rd3_layoutCircle .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 17
          rd3_layoutGrid . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 18
          rd3_multigraph . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 19
          rd3_multiPages . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 20
          rd3_toIgraph . . .    . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 21
          shiny_rd3 . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 22
          sociologists . . . .  . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 22
          timeline_rd3 . . . .  . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . .  . . . . 23
Index                                                                                                       25
  rD3plot-package               The rD3plot package.
Description
    Creates interactive analytic graphs with ’R’. It joins the data analysis power of R and the visualiza-
    tion libraries of JavaScript in one package. The package provides interactive networks, timelines,
    barplots, image galleries and evolving networks. Graphs are represented as D3 graphs embedded in
    a web page ready for its interactive analysis and exploration
  add_tutorial_rd3              Adds a tutorial for the gallery.
Description
    add_tutorial_rd3 adds a tutorial for a gallery.
Usage
    add_tutorial_rd3(x, image = NULL, description = NULL)
Arguments
    x                    object of class gallery_rd3.
    image                character vector indicating the image path, header for the tutorial.
    description          a character string indicating a desription text to insert in the tutorial.
barplot_rd3                                                                                        3
Value
    Object of class gallery_rd3.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    data("finches")
    finches$species <- system.file("extdata", finches$species,
             package="rD3plot") # copy path to the species field
    gallery <- gallery_rd3(finches, image="species", main="Species in Galapagos Islands",
             note="Data source: Sanderson (2000)")
    gallery <- add_tutorial_rd3(gallery,
       description="Here you can see different finches species in Galapagos islands.")
    ## Not run:
    plot(gallery)
    ## End(Not run)
  barplot_rd3                 Networked barplot.
Description
    barplot_rd3 produces an interactive barplot of coincidences between events.
Usage
    barplot_rd3(events, links, name = NULL, select = NULL,
              source = NULL, target = NULL,
              label = NULL, text = NULL, color = NULL,
              incidences = NULL, coincidences = NULL,
              expected = NULL, confidence = NULL, level = .95, significance = NULL,
              sort = NULL, decreasing = FALSE,
              scalebar = FALSE, defaultColor = "#1f77b4", note = NULL, cex = 1,
              language = c("en","es","ca"), dir = NULL)
Arguments
    events             a data frame with at least two columns of event names (by default 1st column)
                       and incidences (2nd column). Columns for each variable can be specified at
                       name and incidences parameters.
4                                                                                            barplot_rd3
    links              a data frame with at least three columns indicating source event, target event and
                       number of coincidences (in that order). Columns assigned to each variable can
                       be specified at source, target and concidences parameters.
    name               column name with event names in the events data frame.
    source             column name with source names in the links data frame.
    target             column name with target names in the links data frame.
    select             event name to start the visualization.
    label              column name with labels in the events data frame.
    text               column name with html text in the events data frame.
    color              column name with color variable in the events data frame.
    coincidences       column nane with coincidences in the links data frame.
    incidences         column name with incidences in the events data frame.
    expected           column name with expected coincidences in the links data frame.
    confidence         column name with confidence interval in the links data frame.
    level              confidence level
    significance       column name with significance in the links data frame.
    sort               column name in the events data frame to order the bars in the graph.
    decreasing         order the events in a decreasing order.
    scalebar           bars are represented filling all the screen height.
    defaultColor       a string giving a valid html color.
    note               the lower title of the graph.
    cex                a number giving the amount by which plotting text should be scaled relative to
                       the default.
    language           a character string indicating the language of the graph (en=english (default);
                       es=spanish; ca=catalan).
    dir                a character string representing the directory where the web files will be saved.
Value
    Object of class barplot_rd3.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    data(finches)
    data(galapagos)
    barplot <- barplot_rd3(finches, galapagos, select="Certhidea olivacea",
                  note="Data source: Sanderson (2000)")
    ## Not run:
    plot(barplot)
    ## End(Not run)
evolNetwork_rd3                                                                                       5
  evolNetwork_rd3             Create evolving networks.
Description
    evolNetwork_rd3 produce an evolving network.
Usage
    evolNetwork_rd3(..., frame = 0, speed = 50, loop = FALSE, lineplots = NULL,
      dir = NULL)
Arguments
    ...                network_rd3 objects that will be integrated as temporal frames in the evolving
                       network.
    frame              a frame ordinal position where the playback will start.
    speed              a percentage value for the playback speed of network frames.
    loop               allowing continuous repetition.
    lineplots          a character vector giving the node attributes to show as lineplots.
    dir                a "character" string representing the directory where the graph will be saved.
Value
    This function returns a network_rd3 object.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    nets <- list()
    N <- data.frame(name=paste0("node",1:2))
    E <- data.frame(Source="node1",Target="node2")
    nets[["net1"]] <- network_rd3(N, E, repulsion=98, label=FALSE)
    for(i in 3:100){
      N <- rbind(N,data.frame(name=paste0("node",i)))
      E <- rbind(E,data.frame(Source=paste0("node",i-1),Target=paste0("node",i)))
      nets[[paste0("net",i-1)]] <- network_rd3(N, E, repulsion=100-i, label=FALSE)
    }
    nets$speed=100
    net <- do.call(evolNetwork_rd3,nets)
6                                                                                              finches
    ## Not run:
    plot(net)
    ## End(Not run)
  finches                     Data: Finches’ attributes in Galapagos islands.
Description
    Data frame with events as result.
Usage
    data("finches")
Format
    A data frame with 13 observations (pinches) and 4 variables (name and characteristics):
    name : Genus and species of the finche
    frequency : number of islands where the finche can be found
    type : Genus of the finche
    species : name of the file containing the picture of the finche
References
    Sanderson, James (2000). Testing Ecological Patterns: A Well-known Algorithm from Computer
    Science Aids the Evaluation of Species Distributions. American Scientist, 88, pp. 332-339.
Examples
    data(finches)
    head(finches,10)
galapagos                                                                                      7
  galapagos                     Data: Finches’ presence in Galapagos Islands.
Description
    Data frame containing data of finches coapperance in the Galagos Islands.
Usage
    data("galapagos")
Format
    This links data set consists of three variables of length 60:
    Source : Finche 1
    Target : Finche 2
    coincidences : number of islands they share
References
    Sanderson, James (2000). Testing Ecological Patterns: A Well-known Algorithm from Computer
    Science Aids the Evaluation of Species Distributions. American Scientist, 88, pp. 332-339.
Examples
    data(galapagos)
    head(galapagos,10)
  gallery_rd3                   Images in a grid gallery.
Description
    gallery_rd3 produces an interactive image gallery.
Usage
    gallery_rd3(nodes, tree = NULL, name = NULL, label = NULL, color = NULL,
         border = NULL, ntext = NULL, info = NULL, infoFrame = c("right","left"),
         image = NULL, zoom = 1, itemsPerRow = NULL, main = NULL, note = NULL,
         showLegend = TRUE, frequencies = FALSE,
         help = NULL, helpOn = FALSE, tutorial = FALSE, description = NULL,
         descriptionWidth = NULL, roundedItems = FALSE, controls = 1:5, cex = 1,
         defaultColor = "#1f77b4", language = c("en", "es", "ca"), dir = NULL)
8                                                                                       gallery_rd3
Arguments
   nodes          a data frame with at least three columns of names, start and end.
   tree           a data frame with two columns: source and target, describing relationships be-
                  tween nodes. It indicates a hierarchy between nodes which can be dynamically
                  explored.
   name           column name with image names in the nodes data frame.
   label          column name with image labels in the nodes data frame.
   color          column name with image background color variable in the nodes data frame.
   border         column name with image border width variable in the nodes data frame or a
                  numeric vector.
   ntext          column name with html text in the nodes data frame.
   info           column name with information to display in a panel in the nodes data frame.
   infoFrame      In which panel should the information be displayed? The left panel is only avail-
                  able if the description argument is provided and frequencies are not showing.
   image          column name which indicates the image paths in the nodes data frame.
   zoom           a number between 0.1 and 10 as initial displaying zoom.
   itemsPerRow    number of items in each row.
   main           upper title of the graph.
   note           lower title of the graph.
   frequencies    a logical value true if barplots representing node attributes frequencies will be
                  added to the final graph.
   showLegend     a logical value true if the legend is to be shown.
   help           a character string indicating a help text of the graph.
   helpOn         Should the help be shown at the beginning?
   tutorial       Should tutorial be displayed?
   description    a character string indicating a desription text for the graph.
   descriptionWidth
                  a percentage indicating a width for the description panel (25 by default).
   roundedItems   Display items with rounded borders.
   controls       a numeric vector indicating which controls will be shown. 1 = topbar, 2 = pdf
                  exportation, 3 = xlsx exportation, 4 = table, 5 = netCoin logo. NULL hide all
                  controls, negative values deny each control and 0 deny all.
   cex            number indicating the amount by which plotting text should be scaled relative
                  to the default.
   defaultColor   a character vector giving a valid html color for node representation.
   language       a character string indicating the language of the graph (en=english (default);
                  es=spanish; ca=catalan).
   dir            a character string representing the directory where the web files will be saved.
miserables                                                                                           9
Value
    Object of class gallery_rd3.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    data("finches")
    finches$species <- system.file("extdata", finches$species,
              package="rD3plot") # copy path to the species field
    gallery <- gallery_rd3(finches, image="species", main="Species in Galapagos Islands",
              note="Data source: Sanderson (2000)")
    ## Not run:
    plot(gallery)
    ## End(Not run)
  miserables                   Coappearance network of characters in Les Miserables (undirected)
Description
    A list of two datasets, vertices and edges, containing data on characters and their coapperance in
    chapters in Victor Hugo’s Les Miserables.
Usage
    data("miserables")
Format
    A list of two data frames:
       • the links data set consists of three variables of length 254:
            – Source: Character 1
            – Target: Character 2
            – value: number of times they appear together in a chapter of Les Miserables
       • the nodes data set consists of two variables with information on 77 characters:
            – name: Character name
            – group: Character group
References
    D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley,
    Reading, MA (1993).
10                                                                                          network_rd3
Examples
     data(miserables)
     head(miserables,10)
   network_rd3                    Interactive network.
Description
     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.
Usage
     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:4,
                cex = 1, background = NULL, defaultColor = "#1f77b4",
                language = c("en","es","ca"), dir = NULL)
Arguments
     nodes                a data frame with at least one column of node names.
     links                a data frame with at least two columns with source and target node names.
     tree                 a data frame with two columns: source and target, describing relationships be-
                          tween nodes. It indicates a hierarchy between nodes which can be dynamically
                          explored.
     name                 name of the column with names in the nodes data frame.
     source               name of the column with source names in the links data frame.
     target               name of the column with target names in the links data frame.
     label                name of the column with labels in the nodes data frame.
network_rd3                                                                                     11
    group        name of the column with groups in the nodes data frame.
    groupText    show names of the groups.
    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 column with label size in the nodes data frame.
    size         name of the column with size in the nodes data frame.
    color        name of the column with color variable in the nodes data frame.
    shape        name of the column with shape variable in the nodes data frame.
    legend       name of the column with the variable to represent as a legend in the nodes data
                 frame.
    ntext        name of the column with html text in the nodes data frame.
    info         name of the column with information to display in a panel in the nodes data
                 frame.
    border       name of the column with border width in the nodes data frame.
    sort         name of the column with node order in the nodes data frame (only for heatmap).
    decreasing   decreasing or increasing sort of the nodes (only for heatmap).
    intensity    name of the column with intensity variable in the links data frame (only for
                 heatmap).
    lwidth       name of the column with width variable in the links data frame.
    lweight      name of the column with weight variable in the links data frame.
    lcolor       name of the column with color variable in the links data frame.
    ltext        name of the column with labels in the links data frame.
    nodeFilter   a character string with a condition for filtering nodes.
    linkFilter   a character string with a condition for filtering links.
    degreeFilter 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.
    nodeBipolar  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.
    linkBipolar  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.
    defaultColor a character vector giving a valid html color for node representation.
    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.
12                                                                                            network_rd3
    main                upper title of the graph.
    note                lower title of the graph.
    frequencies         a logical value true if barplots representing node attributes frequencies will be
                        added to the final graph.
    help                help text of the graph.
    helpOn              Should the help be shown at the beginning?
    background          background color or image path of the graph.
    layout              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")
    limits              vector indicating the layout limits, must be a numeric vector of length 4 on this
                        order: x_min, y_min, x_max, y_max.
    cex                 number indicating the amount by which plotting text should be scaled relative
                        to the default.
    roundedItems        Display images with rounded borders.
    controls            a numeric vector indicating which controls will be shown. 1 = sidebar, 2 =
                        selection buttons, 3 = export buttons, 4 = nodes table, 5 = links table. 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.
    showAxes            a logical value true if the axes are to be shown.
    axesLabels          a character vector giving the axes names.
    language            a character string indicating the language of the graph (en=english (default);
                        es=spanish; ca=catalan).
    image               name of the column with the path to node image files in the nodes data frame.
    imageNames          name of the column with names for image files in the nodes data frame which
                        will be shown in the legend.
    dir                 a "character" string representing the directory where the resulting web files will
                        be saved.
Value
    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.
pie_rd3                                                                                               13
Note
     nodes and links arguments can be substituted by a network_rd3 object to add or change options to
     it.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
     data(miserables)
     net <- network_rd3(miserables$nodes, miserables$links,
               size="degree", color="group", lwidth="value")
     ## Not run:
     plot(net)
     ## End(Not run)
   pie_rd3                      Networked barplot.
Description
     pie_rd3 produces an interactive barplot of coincidences between events.
Usage
     pie_rd3(v, w = NULL, labels = NULL, colors = NULL, nodes = NULL, links = NULL,
         name = NULL, source = NULL, target = NULL, lcolor = NULL,
         ablineX = NULL, ablineY = NULL, hideUpper = FALSE, main = NULL, note = NULL,
         showLegend = TRUE, help = NULL, helpOn = FALSE,
         cex = 1, language = c("en", "es", "ca"), dir = NULL)
Arguments
     v                  a vector or array of non-negative numerical quantities. The values are displayed
                        as the areas of pie slices.
     w                  an array of non-negative numerical quantities. The first value is displayed as a
                        pie slice bordered red.
     labels             character strings giving names for the slices.
     colors             a vector of colors to be used in filling the slices.
     nodes              a data frame with information for rows and columns.
     links              a data frame with information for each pie.
     name               name of the column with rownames and colnames in the nodes data frame.
     source             name of the column with rownames in the links data frame.
14                                                                                  rd3_addDescription
     target             name of the column with colnames in the links data frame.
     lcolor             name of the column with color variable in the links data frame.
     ablineX            adds one or more straight vertical lines between pies.
     ablineY            adds one or more straight horizontal lines between pies.
     hideUpper          should hide the upper triangle?
     main               upper title of the graph.
     note               lower title of the graph.
     showLegend         a logical value true if the legend is to be shown.
     help               a character string indicating a help text of the graph.
     helpOn             Should the help be shown at the beginning?
     cex                number indicating the amount by which plotting text should be scaled relative
                        to the default.
     language           a character vector (es=spanish; en=english; ca=catalan).
     dir                a character string representing the directory where the web files will be saved.
Value
     Object of class pie_rd3.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
     pie <- pie_rd3(1:4, labels = c("XY","X","","Y"),
       colors = c("black","cadetblue2", "white","cadetblue3"))
     ## Not run:
     plot(pie)
     ## End(Not run)
   rd3_addDescription           Adds a description to a ’rD3plot’ object.
Description
     rd3_addDescription adds a description to a ’rD3plot’ object.
Usage
     rd3_addDescription(x, description)
rd3_addImage                                                                             15
Arguments
    x                   A ’rD3plot’ object.
    description         the description text.
Value
    A ’rD3plot’ object.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    data(finches)
    data(galapagos)
    bar <- barplot_rd3(finches, galapagos, select="Certhidea olivacea")
    img <- system.file("extdata", "p.Crassirostris.png",
            package="rD3plot")
    bar <- rd3_addDescription(bar,"Species coincidences in Galapagos Islands")
    multi <- rd3_multigraph(barplot=bar)
    ## Not run:
    rd3_multiPages(multi,"Graph image example",show=TRUE)
    ## End(Not run)
  rd3_addImage                 Adds an image to a ’rD3plot’ object.
Description
    rd3_addImage adds an image to a ’rD3plot’ object.
Usage
    rd3_addImage(x, img)
Arguments
    x                   A ’rD3plot’ object.
    img                 character vector indicating the image path.
Value
    A ’rD3plot’ object.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
16                                                                                 rd3_fromIgraph
Examples
     data(finches)
     data(galapagos)
     bar <- barplot_rd3(finches, galapagos, select="Certhidea olivacea")
     img <- system.file("extdata", "p.Crassirostris.png",
              package="rD3plot")
     bar <- rd3_addImage(bar,img)
     multi <- rd3_multigraph(barplot=bar)
     ## Not run:
     rd3_multiPages(multi,"Graph image example",show=TRUE)
     ## End(Not run)
   rd3_fromIgraph              Produce interactive networks from ’igraph’ objects.
Description
     rd3_fromIgraph produce an interactive network from an ’igraph’ object.
Usage
     rd3_fromIgraph(G, ...)
Arguments
     G                  an igraph object.
     ...                Any network_rd3 argument.
Value
     This function returns a network_rd3 object.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
     g <- igraph::make_ring(10)
     rd3_fromIgraph(g)
rd3_layoutCircle                                                                            17
  rd3_layoutCircle             Produce a circle layout of any number of nodes.
Description
    rd3_layoutCircle produces a circle layout of any number of nodes.
Usage
    rd3_layoutCircle(N,nodes=seq_len(nrow(N)),deg=0,name=NULL)
Arguments
    N                  a data frame of nodes.
    nodes              a vector specifing the node names inclued in the layout calculation.
    deg                rotation degrees.
    name               column name with node names in the N data frame.
Value
    ‘rd3_layoutCircle’ produces a circle layout of any number of nodes.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    A <- data.frame(name=letters)
    L <- rd3_layoutCircle(A,name="name")
    net <- network_rd3(A,layout=L)
    ## Not run:
    plot(net)
    ## End(Not run)
18                                                                                rd3_layoutGrid
   rd3_layoutGrid              Produce a grid layout of any number of nodes.
Description
     rd3_layoutGrid produces a grid layout of any number of nodes.
Usage
     rd3_layoutGrid(N,string,name=NULL,byrow=FALSE)
Arguments
     N                 a data frame of nodes.
     string            a character vector specifing grouped nodes.
     name              column name with node names in the N data frame.
     byrow             order nodes by row (default) or by columns (FALSE)
Value
     ‘rd3_layoutGrid’ produces a grid layout of any number of nodes.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
     A <- data.frame(name=letters)
     L <- rd3_layoutGrid(A,"a,b,c,d,e.f,g,h,i,j.k,l,m,n,o,p.q,r,s,t,u.v,w,x,y,z","name")
     net <- network_rd3(A,layout=L)
     ## Not run:
     plot(net)
     ## End(Not run)
rd3_multigraph                                                                                        19
  rd3_multigraph               Integrates interactive ’rD3plot’ graphs.
Description
    rd3_multigraph produce an interactive multi graph with the integration of ’rD3plot’ graphs in the
    final result.
Usage
    rd3_multigraph(..., mfrow = NULL, dir = NULL)
Arguments
    ...                rD3plot graphs (network_rd3, barplot_rd3, timeplot_rd3) objects or string paths
                       to html "directories".
    mfrow              a vector of the form ’c(nr, nc)’. Subsequent graphs will be drawn in an ’nr’-by-
                       ’nc’ array on the device by rows.
    dir                a "character" string representing the directory where the graph will be saved.
Value
    This function returns a multi_rd3 object.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    data(miserables)
    net <- network_rd3(miserables$nodes, miserables$links,
               size="degree", color="group", lwidth="value")
    data(finches)
    data(galapagos)
    bar <- barplot_rd3(finches, galapagos, select="Certhidea olivacea")
    data(sociologists)
    time <- timeline_rd3(sociologists,"name","birth","death","birthcountry")
    multi <- rd3_multigraph(network=net, barplot=bar, timeline=time)
    ## Not run:
    plot(multi)
    ## End(Not run)
20                                                                                       rd3_multiPages
   rd3_multiPages               Produces a gallery of ’rD3plot’ graphs.
Description
     rd3_multiPages produces a gallery page to explore multiple ’rD3plot’ graphs.
Usage
     rd3_multiPages(x, title = NULL, columns = NULL, imageSize = NULL,
       description = NULL, note = NULL,
       cex = 1, dir = tempDir(), show = FALSE)
Arguments
     x                  is a multi_rd3 object. See rd3_multigraph
     title              the text for a main title.
     columns            a numeric vector giving the number of columns to display items in gallery. De-
                        fault = 3.
     imageSize          a numeric vector giving the size of images in gallery. Default = 75.
     description        a description text for the gallery.
     note               a footer text for the gallery.
     cex                number indicating the amount by which plotting text should be scaled relative
                        to the default. Default = 1.
     dir                a "character" string representing the directory where the graph will be saved.
     show               a logical value true if the graph is to be shown. Default = FALSE.
Value
     The function creates a folder in your computer with an HTML document named index.html which
     contains the graph. This file can be directly opened with your browser.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
     data(miserables)
     net <- network_rd3(miserables$nodes, miserables$links,
               size="degree", color="group", lwidth="value")
     data(finches)
     data(galapagos)
     bar <- barplot_rd3(finches, galapagos, select="Certhidea olivacea")
rd3_toIgraph                                                                             21
    data(sociologists)
    time <- timeline_rd3(sociologists,"name","birth","death","birthcountry")
    multi <- rd3_multigraph(network=net, barplot=bar, timeline=time)
    ## Not run:
    rd3_multiPages(multi,"Some graphs",show=TRUE)
    ## End(Not run)
  rd3_toIgraph                ’igraph’ object.
Description
    creates an igraph object from a network_rd3 object.
Usage
    rd3_toIgraph(net)
Arguments
    net                is a network_rd3 object. See network_rd3
Value
    An igraph object.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    # A character column (with separator)
    data(miserables)
    net <- network_rd3(miserables$nodes, miserables$links,
      size="degree", color="group", lwidth="value")
    rd3_toIgraph(net) # conversion into a igraph object
22                                                                                         sociologists
   shiny_rd3                   Include rD3plot graphs in ’Shiny’.
Description
     Load a rD3plot graph to display in ’Shiny’.
Usage
     shiny_rd3(x)
Arguments
     x                  is a network_rd3, barplot_rd3 or timeplot_rd3 object.
Value
     This function returns a shiny.tag object.
Author(s)
     Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
   sociologists                Data: Sociologists born in the 19th century.
Description
     Data frame with names, birth and death year data, birth country and movement.
Usage
     data("sociologists")
Format
     A data frame with 33 observations and the following 4 variables (events) to study coincidences in
     time:
     name : name and last name of the sociologist
     birth : birth year
     death : death year
     birthcountry : birth country
     movements : movement or school of thought
timeline_rd3                                                                                         23
Source
     Own elaboration from manuals of sociology.
Examples
     data(sociologists)
     head(sociologists, 10)
     tail(sociologists, 10)
   timeline_rd3                 Interactive time-bar plot.
Description
     timeline_rd3 produces a timeline_rd3 object ready for its representation as an interactive time
     line in a web browser.
Usage
     timeline_rd3(periods, name = "name", start = "start", end = "end", group = NULL,
                      text = NULL, main = NULL, note = NULL, info = NULL,
                      events = NULL, eventNames = "name", eventPeriod = "period",
                      eventTime = "date", eventColor = NULL, eventShape = NULL,
                      cex = 1, language = c("en","es","ca"), dir = NULL)
Arguments
     periods            a data frame with at least three columns describing period names, start and end.
     name               name of the column with names in the periods data frame.
     start              name of the column with starts in the periods data frame.
     end                name of the column with ends in the periods data frame.
     group              name of the column with a grouping criteria in the periods data frame.
     text               name of the column with a descriptive text of periods (html format) in the peri-
                        ods data frame.
     main               upper title of the graph.
     note               lower title of the graph.
     info               name of the column in the periods data frame with information to display on the
                        information panel.
     events             a data frame of events related to periods (shown as dots) with three columns:
                        interval name, event name and event date
     eventNames         name of the column with event identifiers in the events data frame.
     eventPeriod        name of the column with interval identifiers in the events data frame.
     eventTime          name of the column with time points in the events data frame.
24                                                                                         timeline_rd3
    eventColor         name of the column with the color criteria in the events data frame.
    eventShape         name of the column with the shape criteria in the events data frame.
    cex                number indicating the amount by which plotting text should be scaled relative
                       to the default.
    language           a character string indicating the language of the graph (en=english (default);
                       es=spanish; ca=catalan).
    dir                a "character" string representing the directory where the web files will be saved.
Value
    Object of class timeline_rd3.
Author(s)
    Modesto Escobar, Department of Sociology and Communication, University of Salamanca.
Examples
    # Database of 19th century sociologists
    data(sociologists)
    timeline <- timeline_rd3(sociologists,"name","birth","death","birthcountry")
    ## Not run:
    plot(timeline)
    ## End(Not run)
Index
∗ datasets
     finches, 6
     galapagos, 7
     miserables, 9
     sociologists, 22
add_tutorial_rd3, 2
barplot_rd3, 3
evolNetwork_rd3, 5
finches, 6
galapagos, 7
gallery_rd3, 7
miserables, 9
network_rd3, 10, 16, 21
pie_rd3, 13
rd3_addDescription, 14
rd3_addImage, 15
rd3_fromIgraph, 16
rd3_layoutCircle, 17
rd3_layoutGrid, 18
rd3_multigraph, 19, 20
rd3_multiPages, 20
rd3_toIgraph, 21
rD3plot-package, 2
shiny_rd3, 22
sociologists, 22
timeline_rd3, 23
                        25
