簡體   English   中英

使用 heatmaply 創建帶有原始值/數據而不進行轉換的熱圖?

[英]Use heatmaply to create heatmap with raw values/data without transformations?

使用heatmaply::heatmaply()創建熱圖時,會對原始數據執行一些轉換。 這在以下示例中很明顯,其中提供了一些 iris 數據集,但將鼠標懸停在熱圖上會顯示一些負值(這些值不在提供給heatmaply()的原始數據中),並且側面的顏色欄也顯示為負價值觀也是如此。

https://i.stack.imgur.com/Mt0vGm.png

library(heatmaply)
mat <- iris[1:20, 1:4] %>% as.matrix
p <- heatmaply(mat, 
                   dendrogram = "none",
                   xlab = "", ylab = "", 
                   main = "",
                   scale = "column",
                   margins = c(60,100,40,20),
                   grid_color = "white",
                   grid_width = 0.00001,
                   titleX = FALSE,
                   hide_colorbar = FALSE,
                   branches_lwd = 0.1,
                   label_names = c("Country", "Feature:", "Value"),
                   fontsize_row = 5, fontsize_col = 5,
                   labCol = colnames(mat),
                   labRow = rownames(mat),
                   heatmap_layers = theme(axis.line=element_blank()),
                   colors = rev(c("000000", heat.colors(30)[1:28]))
)

p

iris[1:20, 1:4]的不同比例:

https://i.stack.imgur.com/nuMcn.png

問題

如何heatmaply::heatmaply()純粹基於提供的原始值(無轉換)生成熱圖?

注意:開放使用其他包/功能/建議

刪除scale參數 - 默認為“無”。 或將其更改為“無”。

heatmaply(mat, 
          dendrogram = "none",
          xlab = "", ylab = "", 
          main = "",
          # scale = "column",  # <-- remove this line. Or change to "none"
          margins = c(60,100,40,20), ...

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM