Learn R Programming

netdiffuseR (version 1.23.0)

split_behaviors: Splitting behaviors

Description

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.

Usage

split_behaviors(diffnet_obj)

Value

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

Arguments

diffnet_obj

A multi-diffusion diffnet object.

Author

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

Examples

Run this code
# Running a multi-diffusion simulation
set.seed(1231)
diffnet_multi <- rdiffnet(50, 5, seed.p.adopt = list(0.1,0.1))

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))

Run the code above in your browser using DataLab