% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/covariates.R
\name{attach_covariates_df}
\alias{attach_covariates_df}
\title{Attach exogenous covariates to a pre-built risk-set data frame}
\usage{
attach_covariates_df(pe, covariates)
}
\arguments{
\item{pe}{Data frame returned by \code{remstats_generate()} (or
equivalently, the \code{pe} object inside \code{\link[=fit_rem]{fit_rem()}}), with a \code{time} column.}

\item{covariates}{A \code{\link[=rem_covariates]{rem_covariates()}} object.}
}
\value{
\code{pe} with additional covariate columns appended.
}
\description{
Convenience wrapper for applying a \code{\link[=rem_covariates]{rem_covariates()}} object to the output
of \code{remstats_generate()} after the fact.  Useful for testing or for
workflows that build the risk set once and experiment with different
covariate specifications.
}
\examples{
\dontrun{
data(edgelist)
el   <- prepare_edgelist(edgelist)
gdp  <- cov_node_static("GDP", data.frame(
  node = sort(unique(c(el$sender, el$receiver))),
  value = runif(length(unique(c(el$sender, el$receiver))))
))
covs <- rem_covariates(gdp)
fit  <- fit_rem(el[1:100, ],
  survival::Surv(time1, occurred) ~ GDP + Repetition +
    survival::strata(time2),
  n_nonevents = 30L, method = "clogit", covariates = covs)
}
}
