geom_trimesh {quollr} | R Documentation |
Create a trimesh plot
Description
Create a trimesh plot
Usage
geom_trimesh(
mapping = NULL,
data = NULL,
stat = "trimesh",
position = "identity",
show.legend = NA,
na.rm = FALSE,
inherit.aes = TRUE,
...
)
Arguments
mapping |
Aesthetic mappings for the plot. |
data |
The data to be plotted. |
stat |
The statistical transformation to be applied. |
position |
The position adjustment to be applied. |
show.legend |
Whether to show the legend for this layer. |
na.rm |
Whether to remove missing values. |
inherit.aes |
Whether to inherit aesthetics from the plot or the layer. |
... |
Additional arguments to be passed to the 'layer' function. |
Value
A 'ggplot2' layer object.
Examples
num_bins_list <- calc_bins(data = s_curve_noise_umap_scaled, x = "UMAP1",
y = "UMAP2", hex_size = NA, buffer_x = NA, buffer_y = NA)
num_bins_x <- num_bins_list$num_x
num_bins_y <- num_bins_list$num_y
hb_obj <- hex_binning(data = s_curve_noise_umap_scaled,
x = "UMAP1", y = "UMAP2", num_bins_x = num_bins_x,
num_bins_y = num_bins_y, x_start = NA, y_start = NA, buffer_x = NA,
buffer_y = NA, hex_size = NA, col_start = "UMAP")
all_centroids_df <- as.data.frame(do.call(cbind, hb_obj$centroids))
counts_df <- as.data.frame(do.call(cbind, hb_obj$std_cts))
df_bin_centroids <- extract_hexbin_centroids(centroids_df = all_centroids_df, counts_df = counts_df)
ggplot2::ggplot() +
geom_trimesh(data = df_bin_centroids, mapping = ggplot2::aes(x = c_x, y = c_y))
[Package quollr version 0.1.1 Index]