plot_data | R Documentation |
The position of the nodes is based on the similarity between them.
Plot how similar are the data
plot_data(x, top)
plot_similarity(pd)
x |
Matrix with the similarities. |
top |
a number between 0 and 1 to select the edges relating the elements of the matrix. |
pd |
The plot data from |
A list with two elements:
nodes: The position and name of the nodes
edges: The information about the selected edges
A ggplot object
if (require("org.Hs.eg.db") & require("reactome.db")) {
# Extract the paths of all genes of org.Hs.eg.db from KEGG
# (last update in data of June 31st 2011)
genes.kegg <- as.list(org.Hs.egPATH)
# Extracts the paths of all genes of org.Hs.eg.db from reactome
genes.react <- as.list(reactomeEXTID2PATHID)
sim <- mgeneSim(c("81", "18", "10"), genes.react)
pd <- plot_data(sim, top = 0.25)
if (requireNamespace("ggplot2", quietly = TRUE)){
plot_similarity(pd)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.