I would like to know how can I do for insert greek characters in DiagrammeR. I'm working with DiagrammeR version 1.0.0, R version 3.4.4 (2018-03-15), RStudio Version 0.99.896.
Asked
Active
Viewed 109 times
1 Answers
0
The greekLetters package is your friend. Please follow the steps and the example code below:
1. Install and load the greekLetters package
library(DiagrammeR)
# install.packages("greekLetters") if you haven't install it
library(greekLetters)
2. Run a simple graph with English letters
DiagrammeR(
"graph LR
A --> B
")
You will see:
3. View Greek letters by using the greeks() function
For example, by running:
greeks("alpha")
You will get:
"α"
4. Assembling Greek letters together with DiagrammeR
Run:
A <- greeks("alpha") # Assign α as A
B <- greeks("beta") # Assign β as B
diagram <- paste0("graph LR;", A, "-->", B) # Assembling A and B with Mermaid string
DiagrammeR(diagram = diagram) # create graph by calling the string
You will then get the Greek equivalent of the English graph:

Grasshopper_NZ
- 302
- 1
- 10