Skip to contents

This function generates a LangeviTour visualization based on different conditions and input parameters with 2D wireframe.

Usage

show_link_plots(
  df_all,
  df_b,
  df_b_with_center_data,
  benchmark_value,
  distance_df,
  distance_col,
  use_default_benchmark_val = FALSE,
  col_start = "x",
  type_nldr,
  r2
)

Arguments

df_all

A tibble that contains the high-dimensional data and embedding data.

df_b

A tibble that contains the high-dimensional coordinates of bin centroids.

df_b_with_center_data

The dataset with hexagonal bin centroids.

benchmark_value

The benchmark value used to remove long edges (optional).

distance_df

The tibble with distance.

distance_col

The name of the distance column.

use_default_benchmark_val

Logical, indicating whether to use default benchmark value to remove long edges (default is FALSE).

col_start

The text that begin the column name of the high-dimensional data.

type_nldr

The type of non-linear dimensionality reduction (NLDR) used.

r2

The ratio of the ranges of the original embedding components.

Value

A browsable HTML element.

Examples

r2 <- diff(range(s_curve_noise_umap$UMAP2))/diff(range(s_curve_noise_umap$UMAP1))
num_bins_x <- 4
hb_obj <- hex_binning(data = s_curve_noise_umap_scaled, bin1 = num_bins_x,
r2 = r2)
all_centroids_df <- hb_obj$centroids
counts_df <- hb_obj$std_cts
df_bin_centroids <- extract_hexbin_centroids(centroids_df = all_centroids_df,
counts_df = counts_df) |>
dplyr::filter(drop_empty == FALSE)
tr1_object <- tri_bin_centroids(hex_df = df_bin_centroids, x = "c_x", y = "c_y")
tr_from_to_df <- gen_edges(tri_object = tr1_object)
distance_df <- cal_2d_dist(tr_coord_df = tr_from_to_df, start_x = "x_from",
start_y = "y_from", end_x = "x_to", end_y = "y_to",
select_vars = c("from", "to", "distance"))
umap_data_with_hb_id <- hb_obj$data_hb_id
df_all <- dplyr::bind_cols(s_curve_noise_training |> dplyr::select(-ID),
umap_data_with_hb_id)
df_bin <- avg_highd_data(data = df_all, col_start = "x")
df_all <- df_all |> dplyr::select(-ID, -hb_id)
show_link_plots(df_all = df_all, df_b = df_bin, df_b_with_center_data = df_bin_centroids,
benchmark_value = 1.16, distance = distance_df, distance_col = "distance",
use_default_benchmark_val = FALSE, col_start = "x", type_nldr = "UMAP", r2 = r2)