set_null_device("png") # set the png null device
# create a jpeg null device
jpeg_null_device <- function(width, height) {
jpeg(
filename = tempfile(pattern = "jpeg_null_plot", fileext = ".jpg"),
width = width, height = height, units = "in", res = 96
)
dev.control("enable")
}
set_null_device(jpeg_null_device)
Run the code above in your browser using DataLab