Bind simulations list with different situations into a single dataframe

bind_rows(..., .id = NULL)

Arguments

...

Simulation outputs in Cropr format, i.e. a named list of data.frame for each situation.

.id

Name of the column in the new dataframe that identifies the origin of each row. If ... is a simulation output, it is set to "situation" by default.

Value

A single data.frame or tibble binding the rows of all data.Frames or tibbles included in sim

Details

If ... is not of class cropr_simulation, it uses the regular function from dplyr. See e.g. SticsRFiles::get_sim() for an example output format.

Note

You can perform the same for observations with the following: bind_rows(obs, .id = "situation").

See also

split_df2sim

Examples

if (FALSE) {
# Importing an example with three situations with observation:
workspace <- system.file(file.path("extdata", "stics_example_1"),
  package = "CroPlotR"
)
situations <- SticsRFiles::get_usms_list(
  usm_path =
    file.path(workspace, "usms.xml")
)
sim <- SticsRFiles::get_sim(workspace = workspace, usm = situations)

bind_rows(sim)
}