# \donttest{
library(miic)
data(hematoData)
# execute MIIC (reconstruct graph)
miic_obj <- miic(
input_data = hematoData, latent = "yes",
n_shuffles = 10, conf_threshold = 0.001
)
# Using igraph
if(require(igraph)) {
g = export(miic_obj, "igraph")
plot(g) # Default visualisation, calls igraph::plot.igraph()
# Specifying layout (see ?igraph::layout_)
l <-layout_with_kk(g)
plot(g, layout=l)
# Override some graphical parameters
plot(g, edge.curved = .2)
plot(g, vertex.shape="none", edge.color="gray85", vertex.label.color="gray10")
}
# In temporal mode, execute MIIC
data(covidCases)
tmiic_obj <- miic(input_data = covidCases, mode = "TS", n_layers = 3, delta_t = 1, mov_avg = 14)
# Plot by default the compact display of the temporal network using igraph
if(require(igraph)) {
g = export (tmiic_obj)
plot(g)
# Plot the raw temporal network using igraph
g = export(tmiic_obj, display="raw")
plot(g)
# Plot the complete temporal network using igraph (completed by stationarity)
g = export(tmiic_obj, display="lagged")
plot(g)
# Specifying layout (see ?igraph::layout_)
l <- layout_on_grid(g, width = 5, height = 3, dim = 2)
plot(g, layout=l)
# For compact temporal display, please be aware that the rendering of
# igraph::plot.igraph() is not optimal when the graph contains
# multiple edges between the same nodes.
# So, the recommend way to plot a compact graph is to use tmiic plotting:
plot(tmiic_obj)
}
# }
Run the code above in your browser using DataLab