## ----- echo = false,消息= false -------------------------------------------------------------------------------------------库(Markdown)options(markdown.html.options = c(options('markdown.html.options')[[1],“ toc”))## ----消息= false,echo = false ------------------------------------------------------------------------------------------------------------------库)## ----- eval = false -------------------------------------------------------------------------------------------------------------------------------------------------------------------#default_axis_param(“列”)#default_axis_param(“ row”)## ----------------------------------------------------------------------------------------------------------------------------------------------------------------#pushViewport(vuteport(layout = grid.layout(...)))#pushViewport(viewport(layout.pos.row = ...,layout.pos.col = ...)))#draw(ht ht(ht), newpage = FALSE) # or draw(ht_list, newpage = FALSE) # popViewport() # ... ## ---- eval = FALSE------------------------------------------------------------ # ht_grob = grid.grabExpr(draw(ht,...))##pushViewport(viewport(layout = grid.layout(...)))#pushViewport(viewport(layout.pos.row = ...,layout.pos.col = ...))#grid.draw(ht_grob)#popviewport()#...## ---------------------------------------------------------------------------------------------------------------------------------- m =矩阵(rnorm(1000*10),nr = 1000)hc = hclust(dist(dist)(dist(dist)(m))group = cutree(hc,k = 6)热图(m,cluster_rows = cluster_within_group(t(m),group),row_split = 6,border = true)#如果还设置row_split ## --------------------------------------------------------------------------------------------------------------------------- m =矩阵(rnorm(100),10)ht = heatmap(m,name =“ foo”,row_dend_width = =单位(4,“ CM”),column_dend_height =单位(4,“ cm”))draw(ht,padding = unit(c(15,2,2,2),“ mm”))decorate_column_dend(“ foo”,“ foo”, { grid.yaxis() }) decorate_row_dend("foo", { vp = current.viewport() xscale = vp$xscale grid.xaxis(at = xscale[2] - 0:5, label = 0:5) }) ## ----------------------------------------------------------------------------- hc = hclust(dist(matrix(rnorm(100), 10))) Heatmap(matrix(nc = 0, nr = 10), cluster_rows = hc, right_annotation = rowAnnotation( foo = anno_points(1:10), sth = 1:10, bar = anno_barplot(1:10)), row_split = 2)