sim_annotate | R Documentation |
sim_annotate
annotates a melted similarity matrix.
sim_annotate(
sim_df,
row_metadata,
annotation_cols,
index = "both",
sim_cols = c("id1", "id2", "sim")
)
sim_df |
data.frame with melted similarity matrix. |
row_metadata |
data.frame with row metadata. |
annotation_cols |
character vector specifying annotation columns. |
index |
optional character string specifying whether to annotate left index, right index, or both.
This must be one of the strings |
sim_cols |
optional character string specifying minimal set of columns for a similarity matrix |
Annotated melted similarity matrix of the same class as sim_df
.
suppressMessages(suppressWarnings(library(magrittr)))
population <- tibble::tibble(
Metadata_group = sample(c("a", "b"), 4, replace = TRUE),
Metadata_type = sample(c("x", "y"), 4, replace = TRUE),
x = rnorm(4),
y = x + rnorm(4) / 100,
z = y + rnorm(4) / 1000
)
annotation_cols <- c("Metadata_group")
sim_df <- matric::sim_calculate(population, method = "pearson")
row_metadata <- attr(sim_df, "row_metadata")
matric::sim_annotate(sim_df, row_metadata, annotation_cols)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.