次の行を覆わないように、2 行を折り返して覆うテキストをプロットするにはどうすればよいですか? 次に例を示します。
library(gplots)
a <- data.frame(a = c(1,2,3), b = c(4,5,6))
colnames(a)[1] <- "wrap\ntext"
textplot(a)
text
タイトルの単語がナンバーワン (1) を覆っていることは容易にわかります。
私は間違いなく戻ってきて、この問題を解決しなければなりませんでした。最善の解決策は、空の行を挿入し、最初の行名を削除することだと思います。もちろん、さらに行を拡張したい場合は、2 つの空の行を追加します。
library(gplots)
a <- data.frame(a = c(1,2,3), b = c(4,5,6))
colnames(a)[1] <- "wrap\ntext"
textplot(a)
## And here is the solution
a <- rbind(c("", ""), a) ## Insert empty row
rownames(a)<- c("", 1:(dim(a)[1]-1)) ## delete first row name and name other indices
textplot(a)