Plots initial heatmap, creates Iheatmap object
# S4 method for matrix
main_heatmap(
data,
name = "Signal",
x = default_x(data),
y = default_y(data),
colors = pick_continuous_colors(zmid, zmin, zmax),
colorbar_grid = setup_colorbar_grid(),
colorbar_position = 1,
zmid = 0,
zmin = min(data, na.rm = TRUE),
zmax = max(data, na.rm = TRUE),
orientation = c("horizontal", "vertical"),
x_categorical = NULL,
y_categorical = NULL,
row_order = seq_len(nrow(data)),
col_order = seq_len(ncol(data)),
text = signif(data, digits = 3),
tooltip = setup_tooltip_options(),
xname = "x",
yname = "y",
pname = name,
source = "iheatmapr",
show_colorbar = TRUE,
layout = list()
)
Iheatmap-class
object, which can be printed to generate
an interactive graphic
matrix
name of colorbar
x axis labels (by default rownames of data)
y axis labels (by default colnames of data)
color palette or vector of colors
colorbar grid parameters, should be result from
setup_colorbar_grid
colorbar placement, should be positive integer
midpoint for colorscale
minimum for colorscale
maximum for colorscale
should new main plots be added horizontally or vertically?
is x categorical? will guess if not provided
is y categorical? will guess if not provided
row ordering for this heatmap-- will be used for all subsequent elements sharing y axis
column ordering for this heatmap-- will be used for all subsequent elements sharing x axis
text of value to display for data
tooltip options, see setup_tooltip_options
internal name for xaxis
internal name for yaxis
internal plot name
source name for use with shiny
logical to indicate whether to show colorbar
list of layout attributes to pass to plotly, eg. list(font = list(size = 15))
Alicia Schep
add_iheatmap
, to_widget
,
iheatmap
, Iheatmap-class
mat <- matrix(rnorm(20), ncol = 5, nrow = 4)
hm <- main_heatmap(mat)
# Print heatmap if interactive session
if (interactive()) hm
Run the code above in your browser using DataLab