# as.directed

From igraph v0.4.4
by Gabor Csardi

##### Convert between directed and undirected graphs

`as.directed`

converts an undirected graph to
directed, `as.undirected`

is the opposite, it converts a directed
graph to undirected.

- Keywords
- graphs

##### Usage

```
as.directed(graph, mode = "mutual")
as.undirected(graph, mode = "collapse")
```

##### Arguments

- graph
- The graph to convert.
- mode
- Character constant, defines the conversion algorithm. For
`as.directed`

it can be`mutual`

or`arbitrary`

. For`as.undirected`

it can be`each`

or`collapse`

. See details below.

##### Details

Conversion algorithms for `as.directed`

:

- arbitrary

##### Value

- A new graph object.

##### code

`as.undirected`

##### itemize

- each

##### item

collapse

##### See Also

`simplify`

for removing multiple and/or loop edges
from a graph.

##### Examples

```
g <- graph.ring(10)
as.directed(g, "mutual")
g2 <- graph.star(10)
as.undirected(g)
```

*Documentation reproduced from package igraph, version 0.4.4, License: GPL version 2 or later (June, 1991)*

### Community examples

Looks like there are no examples yet.