if(requireNamespace("grid")) {
puglia <- list.files(file.path(find.package(package = 'loon'), "images"),
full.names = TRUE)[1L]
# `img` is a tk image object
img <- setNames(l_image_import_files(puglia),
tools::file_path_sans_ext(basename(puglia)))
raster <- tcl_img_2_r_raster(img)
grid::grid.newpage()
grid::grid.raster(raster)
}
Run the code above in your browser using DataLab