% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidyr.R
\name{tf_spread}
\alias{tf_spread}
\title{Spread a \code{tf}-column into many columns representing the
function evaluations.}
\usage{
tf_spread(data, value, arg, sep = "_", interpolate = FALSE)
}
\arguments{
\item{data}{a data frame with at least one \code{tf}-column}

\item{value}{the name of the \code{tf}-column to 'spread'/evaluate.
You can supply bare variable names etc., see the \code{\link[dplyr:select]{dplyr::select()}}
documentation. Also works without this if there's only one \code{tf} in \code{data},
see examples.}

\item{arg}{(Semi-)optional. A vector of \code{arg}-values on which to evaluate the
functions. If not provided, uses the default \code{arg}s. Should be
specified for \code{tf_irreg}, otherwise \emph{all} observed gridpoints are used for
\emph{every} function.}

\item{sep}{separating character used to create column names for the new columns,
defaults to \code{"_"} for column names "<name of the \code{tf}>_<\code{arg}-value>".
Set to NULL to get column names that only contain the \code{arg}-value.}

\item{interpolate}{\code{interpolate}-argument for evaluating the functional data.
Defaults to FALSE, i.e., \code{tfd}s are \emph{not} inter/extrapolated on unobserved
\code{arg}-values.}
}
\value{
a wider dataframe with the \code{tf}-column spread out into many columns
each containing the functional measurements for one \code{arg}-value.
}
\description{
Similar in spirit to \code{\link[tidyr:spread]{tidyr::spread()}}, but does NOT shorten,
just widens the data frame  -- a \code{tf}-column is spread out into many columns
containing the functional measurements.
}
\examples{
d <- dplyr::tibble(g = 1:3)
d$f <- tf_rgp(3, 11L)
tf_spread(d, f)
tf_spread(d, -g)
tf_spread(d)
}
\seealso{
Other tidyfun data wrangling functions: 
\code{\link{tf_evaluate.data.frame}()},
\code{\link{tf_gather}()},
\code{\link{tf_nest}()},
\code{\link{tf_unnest}()}
}
\concept{tidyfun data wrangling functions}
