0

我想用三列制作过渡图。我使用 Gmisc 包但不使用 transitionPlot 函数,因为它不允许我包含第三列。因此,我使用了下面的代码。我的问题是我的结果转换表是深绿色并且有框阴影。你能帮我改变颜色和摆脱阴影吗?谢谢你。这是我的第一次询问,如果有什么问题,对不起。

这是一个数据框示例(我从stackoverflow中获取了这个,因为我没有数据):

x <- structure(list(Obs = 1:13, Seq.1 = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L), .Label = c("a", "b", "c" ), class = "factor"), Seq.2 = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("c", "d"), class = "factor"), Seq.3 = structure(c(1L, 1L, 1L, 2L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("", "d", "e"), class = "factor"),     Seq.4 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L), .Label = c("", "f"), class = "factor")), .Names = c("Obs", "Seq.1", "Seq.2", "Seq.3", "Seq.4"), class = "data.frame", row.names = c(NA, -13L))


library(Gmisc)
library(dplyr)
transitions <- table(x$Seq.1,x$Seq.2) %>%
getRefClass("Transition")$new(label=c("1st Iteration", "2nd Iteration"))
transitions$box_width = 0.25;
transitions$box_label_cex = 0.7;
transitions$arrow_type = "simple";
transitions$arrow_rez = 300;
table(x$Seq.2,x$Seq.3) %>% transitions$addTransitions(label = '3rd Iteration')
transitions$render()
4

0 回答 0