Description Usage Arguments Value
Useful for subsequently plotting matrices with ggplot2().
This function is a wrapper for reshape2::melt()
.
reshape2::melt()
is used here because it nicely preserves dimnames(x)
as long-form variable columns.
This wrapper function simply formats the variable columns created by reshape2::melt()
to play nice with ggplot2.
Specifically, it reverses one factor's levels such that the diagonal of the matrix plotted by ggplot2 runs from
top-left to bottom-right.
1 |
x |
matrix or array |
col |
numeric index or name of column for which the level ordering should be reversed (defaults to 1; you will likely not need to tweak this) |
... |
additional optional arguments to |
long-form data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.