plot_regional_velocity: plot_regional_velocity

View source: R/functions_velocity.R

plot_regional_velocityR Documentation

plot_regional_velocity

Description

plot_regional_velocity

Usage

plot_regional_velocity(
  tsne_dt,
  tall_var_a,
  tall_var_b,
  x_points,
  y_points = x_points,
  points_as_background = FALSE,
  p = NULL,
  min_N = 0,
  id_to_plot = NULL,
  strategy = c("by_direction", "by_destination")[2],
  arrow_FUN = NULL,
  angle_as_color = FALSE
)

Arguments

tsne_dt

tidy data.table of tsne results. variables names must include: tx, ty, id, and tall_var

tall_var_a

an item in tsne_dt$tall_var. the origin for calculating angle/distance.

tall_var_b

an item in tsne_dt$tall_var. the destination for calculating angle/distance.

x_points

number of equally spaced bins in the x-dimension. Required.

y_points

number of equally spaced bins in the y-dimension. Default is x_points.

points_as_background

if TRUE, show points in background.

p

an existing ggplot to overlay images onto. Default of NULL starts a new plot.

min_N

regional bins with fewer than min_N counts will not be shown.

id_to_plot

character. ids in tsne_dt$id. Default of NULL causes all ids to be used.

strategy

character. must be one of "by_direction" or "by_destination"

arrow_FUN

result of grid::arrow(). Default of NULL does not draw arrowheads.

angle_as_color

if TRUE, a rainbow like scale is applied to angle.

Value

ggplot where regionally binned velocities are summarized.

Examples

data("tsne_dt")
plot_regional_velocity(tsne_dt, unique(tsne_dt$tall_var)[1],
    unique(tsne_dt$tall_var)[2], 4, min_N = 4, arrow_FUN = arrow())

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