tcl_img_2_r_raster {loon}R 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)
}

[Package loon version 1.4.1 Index]