JRN
JRN

Reputation: 213

How can I do this kind of figures/graphs in R? non-statistical figures

I wonder if someone could guide me. I would like to do this kind of figure in R, but I don't know if it's possible. I'm creating a document in R-markdown where I would like to use more images to explain a concept instead of just text.

enter image description here


enter image description here

among others...

any idea? or only it is possible if I do this in a picture?

Thanks for any help!

Upvotes: 1

Views: 94

Answers (2)

tpetzoldt
tpetzoldt

Reputation: 5813

The style of nodes and edges can be configured:

library("DiagrammeR")

create_graph() %>%
  add_cycle(n = 5, label = letters[1:5], 
            node_aes = node_aes(color = "red", width = 1)) %>%
  render_graph()

Upvotes: 1

tpetzoldt
tpetzoldt

Reputation: 5813

You may try package DiagrammeR:

library("DiagrammeR")

create_graph() %>%
  add_cycle(n = 5, label=letters[1:5]) %>%
  render_graph()

see also: https://rich-iannone.github.io/DiagrammeR/graphviz_and_mermaid.html

Upvotes: 2

Related Questions