I am new to R.
I want to create a massive tree diagram that represent a Lotto game in R that looks like Tree Diagram 1 in this picture(I made it via PowerPoint):

The problem is I need to draw 6 balls out of 45 balls. The totally elements in this case will be 127. I tried to create a tree diagram using PowerPoint and it looks like Tree Diagram 2.
Then I gave up. I can't type "match' and "no match" and calculate the probability manually for such a massive diagram.
How can I create a tree diagram that looks like Tree Diagram 2 that has similar labels in Tree Diagram 1?
The DiagrammeR package should be helpful:
library(DiagrammeR)
nodes <- create_nodes(nodes = 1:7, type = "number")
edges <- create_edges(from = c(1, 1, 2, 2, 3, 3),
                        to = c(2, 3, 4, 5, 6, 7),
                       rel = "leading to")
graph <- create_graph(nodes_df = nodes, 
                      edges_df = edges, 
                      graph_attrs = "layout = dot", 
                      node_attrs = "fontname = Helvetica", 
                      edge_attrs = "color = gray20") 
# View the graph
render_graph(graph)

You can get "fancy" with the programming and labels accordingly:
nodes <- create_nodes(nodes = 1:7, type = "number",
                      label = c("Lotto", rep(c("match", "no match"), times = 3)))
### Same Code as Above...

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With