# NOT RUN {
cap <- agg_capture()
plot(1:10, 1:10)
# Get the plot as a matrix
raster <- cap()
# Get the plot as a nativeRaster
raster_n <- cap(native = TRUE)
dev.off()
# Look at the output
plot(as.raster(raster))
# }
Run the code above in your browser using DataLab