% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trajectory-methods.R
\name{length.trajectory}
\alias{length.trajectory}
\alias{get_n_activities}
\title{Number of Activities in a Trajectory}
\usage{
\method{length}{trajectory}(x)

get_n_activities(x)
}
\arguments{
\item{x}{the trajectory object.}
}
\value{
Returns a non-negative integer of length 1.
}
\description{
Get the number of activities in a trajectory. \code{length} returns the number
of first-level activities (sub-trajectories not included). \code{get_n_activities}
returns the total number of activities (sub-trajectories included).
}
\examples{
x <- trajectory() \%>\%
  timeout(1)

x <- x \%>\%
  clone(2, x, x)
x

## length does not account for subtrajectories
length(x)
get_n_activities(x)

}
\seealso{
\code{\link{Extract.trajectory}}, \code{\link{join}}.
}
