Preview a saved PNG in an R device window

后端 未结 3 1065
独厮守ぢ
独厮守ぢ 2020-12-17 09:17

Is there a way print an existing PNG file to the device window, for example, let\'s say that you have saved a plot as PNG but you would like to preview it (for sanity) befor

3条回答
  •  粉色の甜心
    2020-12-17 09:23

    Baptiste's answer didn't work for me while using RStudio in Linux. I had to remove the system.file() call.

    library(png)
    img <- readPNG('/path/image.png')
    grid::grid.raster(img)
    

提交回复
热议问题