R/InformativeHeatmap.R
updateLayerFun-InformativeHeatmap-method.Rd
This method allows updating the layer function of an existing InformativeHeatmap
object.
It requires the ComplexHeatmap
package to recreate the heatmap with the new layer function.
If ComplexHeatmap
is not installed, it will stop and prompt the user to install ComplexHeatmap
.
# S4 method for class 'InformativeHeatmap'
updateLayerFun(x, layer_fun)
Returns an updated InformativeHeatmap
object with the new layer function applied.
# \donttest{
# Assume `ih` is an existing InformativeHeatmap object
# Define a new layer function
new_layer_fun <- function(j, i, x, y, w, h, fill) {
grid::grid.points(x, y, pch = 16, size = unit(2, "mm"), gp = grid::gpar(col = "red"))
}
# Update the layer function of the heatmap
ih <- updateLayerFun(ih, new_layer_fun)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'updateLayerFun': object 'ih' not found
# }