reconhub / outbreaker2

Disease outbreak reconstruction from epidemiological and genetic data
http://www.repidemicsconsortium.org/outbreaker2/
Other
30 stars 20 forks source link

Error message when drawing network plot #79

Open r0sies opened 3 years ago

r0sies commented 3 years ago

Hi,

When visualising the transmission links as a network, I receive the below error. I have generated network plots using the same code for several mrsa and one vre clusters, however for two other vre clusters I am receiving the below error. Are there any ways around this? Thanks.

load("raw_dates_vre.RData") load("res_vre.RData")

node labels

dates <- raw_dates$date names(dates) <- raw_dates$name labels <- names(dates)

network plot

p <- plot(res, type = 'network') %>% visNodes(font = list(size = 20)) Error in $<-.data.frame(*tmp*, "arrows", value = "to") : replacement has 1 row, data has 0

p <- plot(res, type = 'network', min_support=0.01) %>% visNodes(font = list(size = 20)) Error in $<-.data.frame(*tmp*, "arrows", value = "to") : replacement has 1 row, data has 0

finlaycampbell commented 3 years ago

Hi - I suspect this may be because no links in your network are above the minimum support (even if you've set it to 0.01). Could you try setting it to 0 just to check if that solves the problem? If that's the error, I'll make sure to provide a more informative error message.