require(igraph)
## network representation for objects of class 'rcc'
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)
# may not work on the Linux version, use Windows instead
network(nutri.res, comp = 1:3, threshold = 0.6)
## Changing the attributes of the network
network(nutri.res, comp = 1:3, threshold = 0.45,
color.node = c("mistyrose", "lightcyan"),,
shape.node = c("circle", "rectangle"),
color.edge = jet.colors(8),
lty.edge = c("solid", "solid"), lwd.edge = c(2, 2),
show.edge.labels = FALSE)
## interactive 'threshold'
network(nutri.res, comp = 1:3, threshold = 0.55, interactive = TRUE)
## select the 'threshold' and "see" the new network
## network representation for objects of class 'spls'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3,
keepX = c(50, 50, 50), keepY = c(10, 10, 10))
network(toxicity.spls, comp = 1:3, threshold = 0.8,
X.names = NULL, Y.names = NULL, keep.var = TRUE,
color.node = c("mistyrose", "lightcyan"),
shape.node = c("rectangle", "circle"),
color.edge = c("red", "blue"),
lty.edge = c("solid", "solid"), lwd.edge = c(1, 1),
show.edge.labels = FALSE, interactive = FALSE)
Run the code above in your browser using DataLab