| plot.early_lucid | R Documentation |
Draws the fitted model as a Sankey diagram: exposures flow into the latent clusters, and the clusters flow on into the omics features and the outcome. Each node is either a variable (exposure, omics or outcome) or a latent cluster, and its colour indicates which. Each link is an estimated association: its width is the magnitude of the effect and its colour the sign, so the diagram shows at a glance which exposures drive which cluster and how that cluster differs in the omics layer.
Only exposures and omics features retained by the model are drawn, so a penalized fit yields a correspondingly sparser diagram.
## S3 method for class 'early_lucid'
plot(x, ...)
x |
A LUCID model fitted by |
... |
Appearance options, all optional:
|
An HTML widget created by sankeyNetwork. It
renders when printed, in the RStudio viewer or a browser, and can be written
to a standalone file with htmlwidgets::saveWidget.
Implemented for early integration only. A lucid_parallel or
lucid_serial fit has a registered method
(plot.lucid_parallel/plot.lucid_serial), but
it raises an error: the parallel and serial diagrams are still under
development.
# prepare data (a small subset keeps the example quick)
G <- sim_data$G[1:150, ]
Z <- sim_data$Z[1:150, ]
Y_normal <- sim_data$Y_normal[1:150, , drop = FALSE]
# plot lucid model
fit1 <- estimate_lucid(G = G, Z = Z, Y = Y_normal, lucid_model = "early",
CoY = NULL, family = "normal", K = 2, seed = 1008,
max_itr = 20, max_tot.itr = 50)
plot(fit1)
# change node color
plot(fit1, G_color = "yellow")
plot(fit1, Z_color = "red")
# change link color
plot(fit1, pos_link_color = "red", neg_link_color = "green")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.