set_image_rects | R Documentation |
configures result of prep_images by setting rectangle parameters
set_image_rects( image_dt, x_points, y_points, xrng, yrng, N_floor = 0, N_ceiling = NULL, min_size = 0.3 )
image_dt |
$image_dt of result from prep_images() |
x_points |
numeric. number of grid points to use in x dimension. |
y_points |
numeric. number of grid points to use in y dimension. |
xrng |
view domain in x dimension. |
yrng |
view domain in y dimension. |
N_floor |
The value of N to consider 0. bins with N values <= N_floor will be ignored. |
N_ceiling |
The value of N to consider 1. bins with N values >= N_ceiling will have images drawn at full size. |
min_size |
Numeric (0, 1]. The minimum size images to draw. The default of .3 draws images for all bins with N values >= 30 N_floor to N_ceiling. |
image_dt with rect aesthetics (xmin, xmax, ymin, and ymax) added.
library(ggplot2) data("profile_dt") data("tsne_dt") summary_dt = prep_summary(profile_dt, tsne_dt, x_points = 4) img_res = prep_images(summary_dt, 4) img_rect = set_image_rects(img_res$image_dt, x_points = img_res$x_points, y_points = img_res$y_points, xrng = img_res$xrng, yrng = img_res$yrng) ggplot(img_rect, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax)) + geom_rect() ggplot(img_rect, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, image = png_file)) + geom_image.rect()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.