Closed henriquesposito closed 4 months ago
This has been fixed I believe, the code below appears to plot correctly.
set.seed(1234) net <- generate_random(to_undirected(to_unnamed(ison_networkers)), with_attr = FALSE) .data <- play_diffusion(net, seeds = 10, latency = 0.25, recovery = 0.2, steps = 10) graphs(.data, waves = 10) grapht(.data)
There still seems to be an issue here. See:
plot(play_diffusion(rando, seeds = 1:2,
recovery = 0.2, waning = 0.1)) # shows nodes becoming susceptible again
grapht(play_diffusion(rando, seeds = 1:2,
recovery = 0.2, waning = 0.1)) # nodes don't revert to blue after green
Thank you for the feedback @jhollway , I think I have also addressed this issue with the latest changes, please let me know. See:
graphs(play_diffusion(generate_random(32), seeds = 1:2, recovery = 0.2, waning = 0.1), waves = c(0, 5, 10, 15, 20, 25, 30))
The nodes that are susceptible move to becoming 'recovered' immediately without being infected first when plotting difussion models with
graphs()
andgrapht()
. The issues could be related to how 'diff_model' objects are converted to 'tidygraph' objects (i.e. information about node attributes related to infected, susceptible, and recovered nodes anymore).For example:
graphs(play_diffusion(generate_random(to_undirected(to_unnamed(ison_networkers)), with_attr = FALSE), seeds = 10, latency = 0.25, recovery = 0.2, steps = 10))
and
as_tidygraph(play_diffusion(generate_random(to_undirected(to_unnamed(ison_networkers)), with_attr = FALSE), seeds = 10, latency = 0.25, recovery = 0.2, steps = 10))