Split each behavior within multi-diffusion diffnet object. The function gets toa, adopt, cumadopt, and the behavior name from each behavior, and returns a list where each element is a single behavior. All the rest of the structure remains the same for each element in the list.

split_behaviors(diffnet_obj)

Arguments

diffnet_obj

A multi-diffusion diffnet object.

Value

A list of diffnet objects. Each element represent a unique behavior.

Author

George G. Vega Yon & Aníbal Olivera M.

Examples

# Running a multi-diffusion simulation
set.seed(1231)
diffnet_multi <- rdiffnet(50, 5, seed.p.adopt = list(0.1,0.1))
#> Message: Multi-diffusion behavior simulation selected. Number of behaviors:  2
#> Message: Object -seed.nodes- converted to a -list-.All behaviors will have the same -random- seed nodes.
#> Message: Name of 1 behavior provided, but 2 are needed. Names generalized to 'behavior'_1, 'behavior'_2, etc.
#> Warning: Coercing -toa- into integer.

diffnet_multi_list <- split_behaviors(diffnet_multi)
diffnet_single <- diffnet_multi_list[[1]]

# You can now run standard functions for a single behavior
# Plotting single behavior
plot_diffnet(diffnet_single, slices = c(1, 3, 5))