假設我們有一個df
如下所示的資料框:
team_1 team_2 team_3
very_effective 3 5 8
effective 5 6 9
ineffective 6 8 20
我想創建一個具有不同顏色方塊的熱圖,如果值更高,這些方塊會更暗。我嘗試了以下代碼,但出現錯誤object 'X1' is not found
。有誰知道如何解決?謝謝!
library(ggplot2)
ggp <- ggplot(df, aes(X1, X2)) # Create heatmap with ggplot2
geom_tile()
ggp
uj5u.com熱心網友回復:
aes()
期望 x 和 y 值的向量;不是交叉表,也不是未定義的變數:
用法
aes(x, y, ...)
來源:
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/498168.html
上一篇:在R中的火山圖中格式化p值截止線