# as.directed

From igraph v0.5.5-3
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 = c("mutual", "arbitrary"))
as.undirected(graph, mode = c("collapse", "each"))
```

##### 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.

##### concept

- Directed graph
- Undirected graph

##### 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.5.5-3, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.