-
Notifications
You must be signed in to change notification settings - Fork 19
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
add conversion to igraph #98
Labels
Comments
I thought it did exist. Here's the issue:
Make sure it is exported? And that there is a generic |
The issue here is that it IS exported, but igraph needs to be loaded for it to be recognised as a generic: library('epicontacts')
x <- make_epicontacts(outbreaks::ebola_sim$linelist,
outbreaks::ebola_sim$contacts,
id = "case_id", to = "case_id", from ="infector",
directed = TRUE)
as.igraph(x)
#> Error in as.igraph(x): could not find function "as.igraph"
library('igraph')
#>
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#>
#> decompose, spectrum
#> The following object is masked from 'package:base':
#>
#> union
as.igraph(x)
#> IGRAPH 8ae8e6a DN-- 7047 3800 --
#> + attr: name (v/c), generation (v/n), date_of_infection (v/n),
#> | date_of_onset (v/n), date_of_hospitalisation (v/n),
#> | date_of_outcome (v/n), outcome (v/c), gender (v/c), hospital
#> | (v/c), lon (v/n), lat (v/n), id (v/c), source (e/c)
#> + edges from 8ae8e6a (vertex names):
#> [1] d1fafd->53371b cac51e->f5c3d8 f5c3d8->0f58c4 0f58c4->881bd4
#> [5] 8508df->40ae5f 127d83->f547d6 f5c3d8->d58402 20b688->d8a13d
#> [9] 2ae019->a3c8b8 20b688->974bc1 8508df->6a9004 2ae019->72b905
#> [13] 40ae5f->b8f2fd f1f60f->09e386 f9149b->6285c9 f547d6->865581
#> [17] f547d6->5fe599 f9149b->79ad06 aec8ec->c43190 d58402->900021
#> + ... omitted several edges Created on 2019-05-07 by the reprex package (v0.2.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It'd be useful to have something along the lines of
as.igraph(x)
wherex
is an epicontact object so that we can readily perform graph operations. One thing to bear in mind is directionality should be preserved.The text was updated successfully, but these errors were encountered: