1
我有幾個使用R程序包forestplot
製作的森林地塊。我想grid.arrange
他們 - 但它似乎並不容易。Grid.arrange forestplot objects
例子:
library(forestplot)
# A basic example, create some fake data
row_names <- list(list("test = 1", expression(test >= 2)))
test_data <- data.frame(coef=c(1.59, 1.24),
low=c(1.4, 0.78),
high=c(1.8, 1.55))
forestplot(row_names,
test_data$coef,
test_data$low,
test_data$high,
zero = 1,
cex = 2,
lineheight = "auto",
xlab = "Lab axis txt")
確定這將繪製的曲線圖。現在假設我想捕捉到對象的情節就並排着另一個情節:
fp1 <- forestplot(row_names,
test_data$coef,
test_data$low,
test_data$high,
zero = 1,
cex = 2,
lineheight = "auto",
xlab = "Lab axis txt")
下拋出一個錯誤:
> grid.arrange(fp1, fp1)
Hit <Return> to see next plot:
Error in gList(list(path = "GRID.VP.7537", name = "arrange.1-1-1-1", n = 2L, :
only 'grobs' allowed in "gList"
所以克利FP1不是GROB - 但怎麼做我通過其他方式實現了這一點?
THX用戶。選項v1給我一個錯誤:'使用方法錯誤(「深度」): 沒有適用於'深度'類應用於類「NULL」'的對象的方法。選項v2的作品,但在我真正的情節,我有標籤和標題重疊,當我設置'gridExtra :: grid.arrange(fp1,fp2。ncols = 2)' – user2498193
@ user2498193;當您將v1答案複製並粘貼到新的R會話時,是否會收到錯誤? (因爲我不能重現)。 Re v2;它更具有氣質,因爲您需要調整輸出窗口或設備的尺寸來確定合適的位置。 – user20650
在新的會話中仍然會出現錯誤。 Eh re v2 - 不知道該怎麼做。我開始認爲我可能只是手動執行此操作 – user2498193