evolNetwork_rd3: Create evolving networks.

View source: R/multigraph.R

evolNetwork_rd3R Documentation

Create evolving networks.

Description

evolNetwork_rd3 produce an evolving network.

Usage

evolNetwork_rd3(..., timelinks = NULL, timenodes = NULL,
    timestart = NULL, timeend = NULL,
    frame = 0, speed = 50, loop = FALSE, lineplots = NULL, dir = NULL)

Arguments

...

network_rd3 objects (or a list of network_rd3 objects) that will be integrated as temporal frames in the evolving network. If timestart is provided, any network_rd3 argument.

timelinks

a data frame with at least three columns with source, target and timestart to especify evolutive relations. Only used if timestart is provided.

timenodes

a data frame with at least two columns with node names and timestart to especify evolutive values in nodes. Only used if timestart is provided.

timestart

name of the column with the start time of a link in the timelinks data frame.

timeend

name of the column with the end time of a link in the timelinks data frame.

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="node1")
E <- data.frame()

for(i in 2: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)
}

net <- evolNetwork_rd3(nets, speed=100)

## Not run: 
plot(net)

## End(Not run)

links <- data.frame()
repulsion <- numeric()
for(i in 2:100){
  links <- rbind(links, data.frame(Source=paste0("node",i-1),
      Target=paste0("node",i), time=paste0("stage_",i-1)))
  repulsion <- c(repulsion, 100-i)
}

net2 <- evolNetwork_rd3(timelinks=links, timestart="time",
  speed=100, repulsion=repulsion, label=FALSE)

## Not run: 
plot(net2)

## End(Not run)

rD3plot documentation built on April 4, 2025, 4:41 a.m.