I'm developing an R package and want to include a function that overrides igraph::as.igraph()
and lets users convert my custom class into an igraph::igraph
object. What's the correct way to do this?
Import the generic from the igraph package, and export your method for your class.
#' @importFrom igraph as.igraph
NULL
#' @export
as.igraph.yourclass <- function(x, ...)
{
your code here
}