% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DimDataPlot.R
\name{DimDataPlot}
\alias{DimDataPlot}
\title{Data Dimensional Plot}
\usage{
DimDataPlot(
  data,
  x,
  y,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  show_na = FALSE,
  palette = "Chinese",
  palcolor = NULL,
  NA_color = "grey80",
  pt.size = 2,
  pt.alpha = 1,
  shape.values = NULL,
  add_mark = FALSE,
  mark_type = c("hull", "ellipse", "rect", "circle"),
  mark_expand = grid::unit(3, "mm"),
  mark_alpha = 0.1,
  mark_linetype = 1,
  label = FALSE,
  label.size = 4,
  label.fg = "black",
  label.bg = "white",
  label.bg.r = 0.1,
  label_repel = FALSE,
  label_repulsion = 20,
  label_point_size = 1,
  label_point_color = "black",
  label_segment_color = "black",
  add_origin = FALSE,
  origin.color = "grey30",
  origin.linetype = "dashed",
  origin.linewidth = 0.4,
  aspect.ratio = 1,
  title = NULL,
  subtitle = NULL,
  xlab = NULL,
  ylab = NULL,
  legend.position = "right",
  legend.direction = "vertical",
  legend.title = NULL,
  theme_use = "theme_this",
  theme_args = list(),
  seed = 11
)
}
\arguments{
\item{data}{A data frame containing coordinates and optional grouping columns.}

\item{x}{Name of the column used as the x-axis coordinate.}

\item{y}{Name of the column used as the y-axis coordinate.}

\item{group.by}{Name of the column used to color observations.
Default is \code{NULL}.}

\item{split.by}{Name of the column used to split the plot into facets.
Default is \code{NULL}.}

\item{shape.by}{Name of the column used to map point shapes.
Default is \code{NULL}.}

\item{show_na}{Whether to keep missing values in \code{group.by}, \code{split.by},
or \code{shape.by} as an explicit \code{"NA"} level. Default is \code{FALSE}.}

\item{palette}{Color palette name. Available palettes can be found in
\link{show_palettes}. Default is \code{"Chinese"}.}

\item{palcolor}{Custom colors used to create a color palette.
Default is \code{NULL}.}

\item{NA_color}{Color used for missing values.}

\item{pt.size}{Point size.}

\item{pt.alpha}{Point transparency.}

\item{shape.values}{Point shapes used when \code{shape.by} is set.}

\item{add_mark}{Whether to add marks around groups. Default is \code{FALSE}.}

\item{mark_type}{Type of mark to add around groups.
One of \code{"hull"}, \code{"ellipse"}, \code{"rect"}, or \code{"circle"}.
Default is \code{"hull"}. \code{"ellipse"} uses \link[ggplot2:stat_ellipse]{ggplot2::stat_ellipse}
with \code{type = "norm"} and \code{level = 0.95}; the other mark types use ggforce marks.}

\item{mark_expand}{Expansion of the mark around each group.
This is used for \code{"hull"}, \code{"rect"}, and \code{"circle"} marks.
Default is \code{grid::unit(3, "mm")}.}

\item{mark_alpha}{Transparency of the mark.
Default is \code{0.1}.}

\item{mark_linetype}{Line type of the mark border.
Default is \code{1}.}

\item{label}{Whether to label group centers.}

\item{label.size}{Size of labels.}

\item{label.fg}{Foreground color of labels.}

\item{label.bg}{Background color of labels.}

\item{label.bg.r}{Background ratio of labels.}

\item{label_repel}{Whether labels repel from their group centers.}

\item{label_repulsion}{Repulsion force for labels.}

\item{label_point_size}{Size of center points for repelled labels.}

\item{label_point_color}{Color of center points for repelled labels.}

\item{label_segment_color}{Color of label segments.}

\item{add_origin}{Whether to add dashed x = 0 and y = 0 reference lines.}

\item{origin.color}{Color of origin reference lines.}

\item{origin.linetype}{Line type of origin reference lines.}

\item{origin.linewidth}{Line width of origin reference lines.}

\item{aspect.ratio}{Aspect ratio passed to \code{theme()}.}

\item{title}{Plot title.}

\item{subtitle}{Plot subtitle.}

\item{xlab}{Label for the x axis.}

\item{ylab}{Label for the y axis.}

\item{legend.position}{Position of the legend.}

\item{legend.direction}{Direction of the legend.}

\item{legend.title}{Title of the group legend.}

\item{theme_use}{Theme function applied to the plot.}

\item{theme_args}{A named list of arguments passed to \code{theme_use}.}

\item{seed}{Random seed.}
}
\value{
A ggplot object.
}
\description{
Visualize observations on precomputed two-dimensional coordinates.
}
\examples{
set.seed(1)
plot_data <- data.frame(
  x = c(rnorm(40, -1), rnorm(40, 1)),
  y = c(rnorm(40, 0), rnorm(40, 1)),
  group = rep(c("A", "B"), each = 40)
)
DimDataPlot(
  plot_data,
  x = "x",
  y = "y",
  group.by = "group"
)

DimDataPlot(
  plot_data,
  x = "x",
  y = "y",
  group.by = "group",
  add_origin = TRUE,
  mark_type = "ellipse"
)

DimDataPlot(
  plot_data,
  x = "x",
  y = "y",
  group.by = "group",
  mark_type = "circle",
  mark_alpha = 0.3,
  mark_expand = grid::unit(1, "mm"),
  mark_linetype = 2
)
}
