Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when drawing network plot #79

Open
r0sies opened this issue Mar 2, 2021 · 1 comment
Open

Error message when drawing network plot #79

r0sies opened this issue Mar 2, 2021 · 1 comment

Comments

@r0sies
Copy link

r0sies commented Mar 2, 2021

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants