Combining diffnet objects that share time periods and attributes names, but vertices ids (only valid for diffnet objects that have an empty intersection between vertices ids).

# S3 method for class 'diffnet'
c(..., recursive = FALSE)

Arguments

...

diffnet objects to be concatenated.

recursive

Ignored.

Value

A new diffnet object with as many vertices as the sum of each concatenated diffnet objects' number of vertices.

Details

The diffnet objects in ... must fulfill the following conditions:

  1. Have the same time range,

  2. have the same vertex attributes, and

  3. have an empty intersection of vertices ids,

The meta data regarding undirected, value, and multiple are set to TRUE if any of the concatenating diffnet objects has that meta equal to TRUE.

The resulting diffnet object's columns in the vertex attributes ordering (both dynamic and static) will coincide with the first diffnet's ordering.

Examples

# Calculate structural equivalence exposure by city -------------------------
data(medInnovationsDiffNet)

# Subsetting diffnets
city1 <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == 1]
city2 <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == 2]
city3 <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == 3]
city4 <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == 4]

# Computing exposure in each one
city1[["expo_se"]] <- exposure(city1, alt.graph="se", valued=TRUE)
#> 'as(<dgeMatrix>, "dgCMatrix")' is deprecated.
#> Use 'as(., "CsparseMatrix")' instead.
#> See help("Deprecated") and help("Matrix-deprecated").
city2[["expo_se"]] <- exposure(city2, alt.graph="se", valued=TRUE)
city3[["expo_se"]] <- exposure(city3, alt.graph="se", valued=TRUE)
city4[["expo_se"]] <- exposure(city4, alt.graph="se", valued=TRUE)

# Concatenating all
diffnet <- c(city1, city2, city3, city4)
diffnet
#> Dynamic network of class -diffnet-
#>  Name               : Medical Innovation
#>  Behavior           : Adoption of Tetracycline
#>  # of nodes         : 125 (1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, ...)
#>  # of time periods  : 18 (1 - 18)
#>  Type               : directed
#>  Final prevalence   : 1.00
#>  Static attributes  : city, detail, meet, coll, attend, proage, length, ... (58)
#>  Dynamic attributes : expo_se (1)