Hi everyone, I wonder if there is a way to create a flowchart out of R code.
For example, I want the following function in R:
give_me_food <- function(animal) {
if (animal == "monkey") {
food <- "banana"
} else {
food <- "hamburger"
}
food
}
give_me_food("monkey")
give_me_food("dog")
Will be documented with the following mermaid code:
flowchart
A["Is Monkey?"] -->|"Yes"| B["Banana"]
A["Is Monkey?"] -->|"No"| C["Hamburger"]