hagenheat | R Documentation |
Basic heatmap using ggplot, dist, and seriation. No dendrograms are plotted.
hagenheat(
d,
method = "seriate",
seriation_method = NULL,
independent = F,
hc_method = "ward.D",
dist_method = "euclidean",
scale. = "none",
viridis_option = "D",
wrap_labels = T,
rotate_labels = F,
ann_col = NULL,
rev_col = F,
rev_row = F
)
d |
A data frame, matrix, or dist object. Column 1 of a data frame can be row labels. Remaining columns must be numeric. |
method |
"seriate" or "hclust". Default: "seriate" |
seriation_method |
If not specified, 'Spectral' will be used for dist objects, and 'PCA' for matrices and data frames. |
independent |
Whether to seriate a matrix using matrix methods (F) or separate distance matrices for rows and columns (T). Default: F |
hc_method |
Agglomeration method from hclust, Default: 'ward.D' |
scale. |
Whether to scale rows ('row'), columns ('column'), or neither ('none'), Default: 'none' |
viridis_option |
One of the viridis color options, 'A', 'B', 'C', 'D', 'E', Default: 'D' |
wrap_labels |
Logical. Wrap the x-axis labels. Default: T |
rotate_labels |
Logical. Rotate the x-axis labels by 90 degrees. Default: F |
ann_col |
A data frame with two variables. The first column must be the names of the columns of 'd'. The second column contains the annotation values. |
rev_col |
Reverse column order. Default: F |
rev_row |
Reverse row order. Default: F |
dist |
Distance method from dist, Default: 'euclidean' |
Produces a very simple ggplot heatmap using viridis colors.
Rows and columns are ordered using the seriation
package.
For data frames, first column must be row labels. Remaining columns must be numeric.
Scaling, if performed, occurs after seriation, and is therefore only for display purposes.
Seriation methods for objects when independent=T
: list_seriation_methods('dist')
.
Seriation methods for matrices and data frames when independent=F
: list_seriation_methods('matrix')
.
A ggplot object
seriate
seriation_methods
new_scale_fill
## Not run:
if(interactive()){
hagenheat(mtcars, scale. = 'column')
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.