% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paintr-builtins.R
\name{ppVar}
\alias{ppVar}
\alias{pp_placeholders}
\alias{ppNum}
\alias{ppText}
\alias{ppExpr}
\alias{ppUpload}
\title{Placeholder Identity Helpers}
\usage{
ppVar(x = NULL, ...)

ppNum(x = NULL, ...)

ppText(x = NULL, ...)

ppExpr(x = NULL, ...)

ppUpload(x, ...)
}
\arguments{
\item{x}{A column name (\code{ppVar}), numeric (\code{ppNum}), string (\code{ppText}),
expression (\code{ppExpr}), or dataset name/value (\code{ppUpload}). Passed
through unchanged.}

\item{...}{Additional arguments (e.g. named arguments consumed by a
custom placeholder's \code{named_args} schema). Ignored by the built-in
identity implementation.}
}
\value{
The input value unchanged. The no-arg form \code{ppUpload()} does
not return; it aborts with a guard message.
}
\description{
These are the plain-R callables returned by registering the five
built-in ggpaintr placeholders (\code{ppVar}, \code{ppNum}, \code{ppText}, \code{ppExpr},
\code{ppUpload}). Inside a formula passed to \code{\link[=ptr_app]{ptr_app()}} / \code{\link[=ptr_server]{ptr_server()}}
the parser recognises calls to these names as placeholder invocations
and binds them to Shiny widgets (see \code{vignette("ggpaintr-tutorial")}).
Outside \code{ptr_app()} they behave as plain R functions: the first four
return their argument unchanged (identity), so a formula such as
\code{aes(x = ppVar(mpg))} evaluates identically to \code{aes(x = mpg)} under
ggplot2's tidy-eval. \code{ppUpload} is identical when called with an
argument (\code{ppUpload(penguins)} returns \code{penguins}), so a formula such
as \code{ppUpload(penguins) |> filter(...) |> ggplot(...)} evaluates as
plain R when \code{penguins} is in scope. The no-arg form \code{ppUpload()}
aborts outside \code{ptr_app()} — it is meaningful only as a placeholder
slot.
}
\examples{
# Identity inside ggplot2's tidy-eval:
library(ggplot2)
p1 <- ggplot(mtcars, aes(x = mpg)) + geom_histogram(bins = 10)
p2 <- ggplot(mtcars, aes(x = ppVar(mpg))) + geom_histogram(bins = 10)
# p1 and p2 produce the same plot.

# Inside ptr_app() / ptr_server(), the same call binds to a column picker:
if (interactive()) {
  ptr_app(ggplot(mtcars, aes(x = ppVar(mpg), y = ppVar(wt))) + geom_point())
}
}
