1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/transform_to_complement_graph.R
3\name{transform_to_complement_graph}
4\alias{transform_to_complement_graph}
5\title{Create a complement of a graph}
6\usage{
7transform_to_complement_graph(graph, loops = FALSE)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11
12\item{loops}{An option for whether loops should be generated in the
13complement graph.}
14}
15\value{
16a graph object of class \code{dgr_graph}.
17}
18\description{
19Create a complement graph which contains only edges not present in the input
20graph. It's important to nodes that any edge attributes in the input graph's
21edges will be lost. Node attributes will be retained, since they are not
22affected by this transformation.
23}
24\examples{
25# Create a simple graph
26# with a single cycle
27graph <-
28  create_graph() \%>\%
29  add_cycle(n = 4)
30
31# Get the graph's edge
32# data frame
33graph \%>\% get_edge_df()
34
35# Create the complement
36# of the graph
37graph_c <-
38  graph \%>\%
39    transform_to_complement_graph()
40
41# Get the edge data frame
42# for the complement graph
43graph_c \%>\% get_edge_df()
44
45}
46