# [R Course] How to: Create Diagrams

Easily create diagrams with R by using DiagrammeR.

01-30-2020 Nüance-R provides this course to teach you how to create a diagram.

## Open the following packages


library(igraph)
library(DiagrammeR)


DiagrammeR::grViz("digraph graph2

# Choose the layout of your graph

{graph [layout = dot]

node [shape = rectangle, width = 1, style = filled, color = grey]

node [fillcolor = plum]
a

node [fillcolor = azure]
b c d

node [fillcolor = GreenYellow]
h i

node [fillcolor = gold]
s t u v

node [fillcolor = mistyrose]
k l

node [fillcolor = navajowhite]
g

node [fillcolor = lavender]
j

node [fillcolor = paleturquoise]
e f

node [fillcolor = honeydew]
n o p

node [fillcolor = seashell]
q r

node [fillcolor = yellow]
m

# Assign a label to each node

a [label = 'Data Science']
b [label = 'Big Data']
c [label = 'Algorithms']
d [label = 'Stats']
e [label = 'Econometrics']
f [label = 'Bayesian Statistics']
g [label = 'AI']
h [label = 'Structured']
i [label = 'Unstructured']
j [label = 'Domains']
k [label = 'Augmented Intelligence']
l [label = 'Automated Intelligence']
m [label = 'engineering']
n [label = 'social sciences']
o [label = 'management']
p [label = 'decision theory']
q [label = 'data frames']
r [label = 'tables']
s [label = 'text']
t [label = 'images']
u [label = 'sounds']
v [label = 'videos']

# Assign a path to each node

a -> b
a -> c
a -> d
b -> h
b -> i
c -> g
d -> e
d -> f
g -> j
j -> k
j -> l
k -> n
k -> o
k -> p
l -> m
i -> s
i -> t
i -> u
i -> v
h -> q
h -> r

}

")

### Citation

Warin (2020, Jan. 30). Thierry Warin: [R Course] How to: Create Diagrams. Retrieved from https://warin.ca/posts/howto-creatediagrams/
@misc{warin2020[r,
}