set_image_rects: set_image_rects

set_image_rectsR Documentation

set_image_rects

Description

configures result of prep_images by setting rectangle parameters

Usage

set_image_rects(
  image_dt,
  x_points,
  y_points,
  xrng,
  yrng,
  N_floor = 0,
  N_ceiling = NULL,
  min_size = 0.3
)

Arguments

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.

Value

image_dt with rect aesthetics (xmin, xmax, ymin, and ymax) added.

Examples

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

jrboyd/seqtsne documentation built on Nov. 5, 2022, 6:37 a.m.