render_boolean_distance: Render Boolean Distance

View source: R/render_distance.R

render_boolean_distanceR Documentation

Render Boolean Distance

Description

Takes a logical matrix and returns the nearest distance to each TRUE value.

Usage

render_boolean_distance(boolean, rescale = FALSE)

Arguments

boolean

Logical matrix (or matrix of 1s and 0s), where distance will be measured to the TRUE values.

rescale

Default FALSE. Rescales the calculated distance to a range of 0-1. Useful for visualizing the distance matrix.

Value

Matrix of distance values.

Examples


#Measure distance to
plot_image(render_boolean_distance(t(volcano) > 150))
plot_image(render_boolean_distance(t(volcano) < 150))
#If we want to rescale this to zero to one (to visualize like an image), set rescale=TRUE
plot_image(render_boolean_distance(t(volcano) > 150,rescale=TRUE))


rayimage documentation built on June 12, 2026, 5:06 p.m.