I am plotting in xyplot() as per below. I put symbols on the plot with print(panel.points()) and it works. But I need to save the plot with the points to a variable (a in the example) so I can use grid arrange to combine it with other plots in the same picture. Ideas?
dev.off()
x <- c(1:10)
y <- c(1:10)
a <- xyplot(y ~ x, type = "l")
trellis.focus("panel", 1, 1, highlight = FALSE)
print(panel.points(x[c(5,10)],
y[c(5,10)],
pch = 19,
cex = 0.75,
col = c("red", "black")))