tcl_img_2_r_raster: A tk Image Object to a Raster Object

View source: R/loonGrob_l_layer_scatterplot.R

tcl_img_2_r_rasterR Documentation

A tk Image Object to a Raster Object

Description

Turn a tk image object to an R raster object

Usage

tcl_img_2_r_raster(img)

Arguments

img

a tk image object

Examples

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)
}

loon documentation built on July 9, 2023, 5:48 p.m.