Bind simulations list with different situations into a single dataframe
bind_rows(..., .id = NULL)
Simulation outputs in Cropr format, i.e. a named list of
data.frame
for each situation.
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.
A single data.frame or tibble binding the rows of all data.Frames or tibbles included in sim
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.
You can perform the same for observations with the following:
bind_rows(obs, .id = "situation")
.
split_df2sim
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)
}