'Plot data based on three objects as z-scores

I have successfully plotted the three "bridge"-objects in the same plot (with legend) using this code:

p <- lapply(list(DataT5_SDQ_network_b,
                 DataT6_SDQ_network_b,
                 DataT7_SDQ_network_b), function(x) suppressWarnings(plot(x)))

p <- Map(function(a, b) { a$data$Class <- b; a}, a = p, b = c("T5", "T6", "T7"))

p[[1]]$data <- do.call(rbind, lapply(p, function(x) x$data))

p <- p[[1]] + aes(color = Class, group = Class)

p

The result: enter image description here

Questions:

  1. How can I plot the data as z-scores?
  2. How can I get the plot only showing Bridge Expected Influence (1-step)?


Solution 1:[1]

I found out:

First, plot each plot:

gg1 <- plot(DataT5_SDQ_network_b, include=c("Bridge Expected Influence (1-step)"), theme_bw=FALSE, zscore=TRUE)
gg2 <- plot(DataT6_SDQ_network_b, include=c("Bridge Expected Influence (1-step)"), theme_bw=FALSE, zscore=TRUE)
gg3 <- plot(DataT7_SDQ_network_b, include=c("Bridge Expected Influence (1-step)"), theme_bw=FALSE, zscore=TRUE)

Then combine plots

p <- list(gg1, gg2, gg3)
p <- Map(function(a, b) { a$data$Class <- b; a}, a = p, b = c("T5", "T6", "T7"))
p[[1]]$data <- do.call(rbind, lapply(p, function(x) x$data))
p <- p[[1]] + aes(color = Class, group = Class)
p

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brage Kraft