Accepts any mix of streamline and bundle objects. All streamlines are
collected into a flat list and wrapped in a new bundle. bundle_data
from the first bundle argument (if any) is preserved; pass your own via
the bundle_data argument to override. Similarly for streamline_data.
Arguments
- ...
One or more streamline or bundle objects.
- streamline_data
A named list of per-streamline vectors to attach to the resulting bundle. Defaults to the
@streamline_dataof the first bundle input if one is present.- bundle_data
A named list of bundle-level scalar metadata to attach to the resulting bundle. Defaults to an empty list (or the
bundle_dataof the first bundle input if one is present andbundle_datais not supplied).
Value
A bundle containing all input streamlines.
Examples
sl1 <- streamline(points = cbind(X = runif(5), Y = runif(5), Z = runif(5)))
sl2 <- streamline(points = cbind(X = runif(5), Y = runif(5), Z = runif(5)))
b1 <- bundle(streamlines = list(sl1))
b2 <- bundle(streamlines = list(sl2))
# combine two bundles
b_all <- bind_bundles(b1, b2)
b_all@n_streamlines # 2
#> [1] 2
# mix a bundle and a loose streamline
b_mixed <- bind_bundles(b1, sl2)
b_mixed@n_streamlines # 2
#> [1] 2
