Skip to contents

This function generates a LangeviTour visualization based on different conditions and input parameters.

Usage

show_langevitour(
  df,
  df_b,
  df_b_with_center_data,
  benchmark_value,
  distance_df,
  distance_col,
  use_default_benchmark_val = FALSE,
  col_start
)

Arguments

df

A tibble that contains the high-dimensional 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.

Value

A langevitour object with the model and the high-dimensional data.

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")
show_langevitour(df = 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")