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).
# S3 method for trajectory length(x) get_n_activities(x)
x | the trajectory object. |
---|
Returns a non-negative integer of length 1.
#> trajectory: anonymous, 4 activities #> { Activity: Timeout | delay: 1 } #> { Activity: Clone | n: 2 } #> Fork 1, continue, trajectory: anonymous, 1 activities #> { Activity: Timeout | delay: 1 } #> Fork 2, continue, trajectory: anonymous, 1 activities #> { Activity: Timeout | delay: 1 }#> [1] 2get_n_activities(x)#> [1] 4