% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{print_and_capture}
\alias{print_and_capture}
\title{Print a variable and capture the output}
\usage{
print_and_capture(x, ...)
}
\arguments{
\item{x}{A variable.}

\item{...}{Arguments passed to \code{\link[base]{print}} methods.}
}
\value{
A string.
}
\description{
Prints a variable and captures the output, collapsing the value to a single 
string.
}
\examples{
# This is useful for including data frames in warnings or errors
message("This is the sleep dataset:\n", print_and_capture(sleep))
}
\seealso{
\code{\link[base]{print}}, \code{\link[utils]{capture.output}}
}
