% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/collate.R
\name{update_collate}
\alias{update_collate}
\alias{@include}
\title{Update Collate field in DESCRIPTION}
\usage{
update_collate(base_path)
}
\arguments{
\item{base_path}{Path to package directory.}
}
\description{
By default, R loads files in alphabetical order. This is fine if your
package doesn't have any cross-file dependencies, but if you're using a tool
like S4, you'll need to make sure that classes are loaded before subclasses
and generics are defined before methods. You can do this by hand by setting
the \code{Collate} field in the \code{DESCRIPTION} or automate it by using \verb{@include}
tags to specify the cross-file dependencies:

\if{html}{\out{<div class="sourceCode R">}}\preformatted{#' @include before.R
NULL
}\if{html}{\out{</div>}}

If there are no \verb{@include} tags, roxygen2 will leave the \code{Collate} field as
is. This makes it easier to use roxygen2 with an existing collate directive,
but if you remove all your \verb{@include} tags, you'll need to also
manually delete the collate field.

Generally, you should not need to run this function yourself; it will be
run automatically by any package that needs to load your R files in
collation order.

\code{update_collate()} is not not technically a \link{roclet}, like \code{\link[=rd_roclet]{rd_roclet()}}
and \code{\link[=namespace_roclet]{namespace_roclet()}}, because you have to be able to load the pacakge
before you can process it with roclets. However, because it was historical
implemented as a roclet, it's still controlled by the \code{roclets} argument of
\code{\link[=roxygenize]{roxygenize()}}.
}
\examples{
#' If `example-a.R`, `example-b.R` and `example-c.R` live in `R/`
#' and we're in `example-a.R`, then the following @include tag
#' ensures that example-b and example-c are sourced before example-a.
#' @include example-b.R example-c.R
NULL
}
