View source: R/render_distance.R
render_boolean_distance | R Documentation |
Takes an matrix (or and returns the nearest distance to each TRUE.
render_boolean_distance(boolean, rescale = FALSE)
boolean |
Logical matrix (or matrix of 1s and 0s), where distance will be measured to the |
rescale |
Default |
Matrix of distance values.
if(run_documentation()){
#Measure distance to
plot_image(render_boolean_distance(t(volcano) > 150))
plot_image(render_boolean_distance(t(volcano) < 150))
}
if(run_documentation()){
#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))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.