This function can plot and return multiple sparse graphs distinguished by edge colors from the result generated by simule
# S3 method for simule
plot(x, type = "task", neighbouroption = "task",
subID = NULL, index = NULL, hastitle = TRUE, haslegend = TRUE,
...)
output generated from simule function (simule class)
type of graph. There are four options:
"task" (graph for each task (including shared part) specified further by subID (task number))
"share" (shared graph for all tasks)
"taskspecific" (graph for each task specific graph (excluding shared part) specified further by subID (task number) )
"neighbour" (zoom into nodes in the graph specified further by neighbouroptoin, subID (task number) and index (node id))
determines what type of graph to zoom into when parameter "type" is "neighbour". There are two options:
"task" (zoom into graph for each task (including shared part))
"taskspecific" (zoom into graph for each task specific (excluding shared part))
selects which task to display. There are four options:
0 (only allowed when "type" is "task" or "type" is "neighbour" and "neighbouroption" is "task") (selects share graph)
positive task number (selects that particular task)
a vector of task number (selects multiple tasks)
NULL (selects all tasks (all graphs))
determines which node(s) to zoom into when parameter "type" is "neighbour". This parameter could either be an integer or vector of integers representing node ids (zoom into one node or multiple nodes)
determines whether the graph title is displayed or not (TRUE to display / FALSE to hide)
determines whether the graph legend is displayed or not (TRUE to display / FALSE to hide)
extra parameters passed to plot.igraph() and legend() (only the argument "legend" for legend() is available).
Please see plot.igraph
and legend
a plot of graph / subgraph from simule result specified by user input
when only the simule result is provided, the function will plot all graphs with default numeric labels. User can specify multiple subID and multiple index to zoom in multiple nodes on multiple graphs. Each graph will include a descriptive title and legend to indicate correspondence between edge color and task.
# NOT RUN {
library(JointNets)
data(exampleData)
result = simule(X = exampleData , lambda = 0.1, epsilon = 0.45, covType = "cov", FALSE)
plot(result)
# }
Run the code above in your browser using DataLab