length.trajectory: Number of Activities in a Trajectory

View source: R/trajectory-methods.R

length.trajectoryR Documentation

Number of Activities in a Trajectory

Description

Get the number of activities in a trajectory. length returns the number of first-level activities (sub-trajectories not included). get_n_activities returns the total number of activities (sub-trajectories included).

Usage

## S3 method for class 'trajectory'
length(x)

get_n_activities(x)

Arguments

x

the trajectory object.

Value

Returns a non-negative integer of length 1.

See Also

Extract.trajectory, join.

Examples

x <- trajectory() %>%
  timeout(1)

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

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


Bart6114/simmer documentation built on Oct. 2, 2024, 4:52 p.m.