Skip to contents

Converts simulated trajectories to a named list of gmov tracks. The preferred input is a list of track-like objects. A single data frame can also be used if it contains a simulation identifier column. This covers common simulated track outputs and data-frame-like objects following amt coordinate conventions, but it is not a wrapper around amt simulation internals.

Usage

as_gmov_simulations(simulated, id_col = NULL, ...)

Arguments

simulated

A list of track-like objects, or a data frame containing multiple tracks.

id_col

Optional character name of the simulation identifier column when simulated is a data frame. If omitted, gmov looks for common simulation columns such as sim_id, sim_id_, .simulation, simulation, .replicate, or replicate.

...

Passed to as_gmov_track().

Value

A named list of gmov tracks.

Examples

sims <- list(
  data.frame(x = c(0, 1), y = c(0, 0)),
  data.frame(x = c(0, 0), y = c(0, 1))
)
as_gmov_simulations(sims)
#> $sim_1
#> # A tibble: 2 × 4
#>       x     y    x_    y_
#>   <dbl> <dbl> <dbl> <dbl>
#> 1     0     0     0     0
#> 2     1     0     1     0
#> 
#> $sim_2
#> # A tibble: 2 × 4
#>       x     y    x_    y_
#>   <dbl> <dbl> <dbl> <dbl>
#> 1     0     0     0     0
#> 2     0     1     0     1
#> 
#> attr(,"class")
#> [1] "gmov_simulations" "list"