Description Usage Arguments Details Value
View source: R/plot_melted_mat.R
A convenience function that ggplots numeric matrices with sensible defaults.
This function takes a dataframe x
, possibly the output of melt_mat()
, as input, along with
three strings, .row
, .col
, .value
, which indicate the names of the associated columns
in the data.frame.
1 2 3 4 5 6 7 8 | plot_melted_mat(
x,
.row = "Var1",
.col = "Var2",
.value = "value",
geom = "raster",
rotate_xaxis_text = TRUE
)
|
x |
a long-form data.frame |
.row |
character, name of column in |
.col |
character, name of column in |
.value |
character, name of column in |
geom |
"raster" (for |
rotate_xaxis_text |
boolean, should x-axis text (column labels) be rotated 90 degrees? useful with long labels / large matrices. |
#' The default arguments are set to work with the labels that reshape2::melt()
uses when names(dimnames(x)) are not set.
a ggplot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.