我需要使用R将4张图片(.ps)插入到一个多面板(4个盒子)中。有人有提示吗?
我经常搜索,但我找不到解决方案。我现在尝试(但没有成功)的方式是使用屏幕:
m <- rbind(c(0.1, 0.55, 0.55, 1), c(0.55, 1, 0.55, 1),
+ c(0.1, 0.55, 0.1, 0.55), c(0.55, 1, 0.1, 0.55))
split.screen(m)
for(var in 1:4){
screen(var)
PostScriptTrace(paste("var",var,".ps",sep=""),paste("var",var,".xml",sep=""))
Pic = readPicture(paste("var",var,"Dia",d,".xml",sep=""))
par(mar = c(0, 0, 0, 0))
plot(1, axes = FALSE, type = "n",panel = function (x,y,...){grid.picture(Pic)})
box()
} #end do loop for var 4:7
close.screen(all.screens = TRUE)