1
我的數據幀是這樣的:geom_tile和geom_text和facet_wrap產生不正確的混淆矩陣
method1 = c("cam","sce","cam","sce","cam","sce","cam","sce","cam","sce","cam","sce","cam","sce","cam","sce");
method2 = c("cam","cam","sce","sce","cam","cam","sce","sce","cam","cam","sce","sce","cam","cam","sce","sce");
p = c(0,0.191781,0.780822,0,0,0.082192,0.890411,0,0,0.383562,0.616438,0,0,0.054795,0.863014,0);
participant = c("LucO","LucO","LucO","LucO","ad","ad","ad","ad","arthur","arthur","arthur","arthur","evgeny","evgeny","evgeny","evgeny");
mydata = data.frame(method1,method2,p,participant);
我試圖繪製每個參與者的混淆矩陣爲:
p <- ggplot(mydata, aes(x=method1, y=method2, fill=method2)) +
geom_tile(aes(fill = mydata$p)) +
geom_text(aes(fill = mydata$p, label = round(mydata$p, 3) * 100)) +
facet_wrap(~participant, ncol=3, scales="free_x");
不過,現在爲每個participant
繪製錯誤的混淆矩陣。你能幫我解決這個問題嗎?謝謝。