I'm trying to get a feel for the ggraph package by following this demonstration: https://www.r-bloggers.com/plotting-trees-from-random-forest-models-with-ggraph/.
I would like to change the edge type to elbow and have tried replacing geom_edge_link() with geom_edge_elbow() but this returns the  error "Error in FUN(X[[i]], ...) : object 'direction' not found". 
Consulting the manual, I am guesssing this is because the object 'graph' is of class igraph and not dendrogram but I can't be sure and was wondering if someone could suggest a workaround?
Below is the code from the demo in the link above applied to the mtcars dataset:
library(randomForest)
library(igraph)
library(ggplot2)
library(ggraph)
data(mtcars)
mtcars_rf <- randomForest(mpg ~ ., data=mtcars, ntree=1000)
  # get tree by index
  tree <- randomForest::getTree(mtcars_rf, 
                                k = 100, 
                                labelVar = TRUE) %>%
    tibble::rownames_to_column() %>%
    # make leaf split points to NA, so the 0s won't get plotted
    mutate(`split point` = ifelse(is.na(prediction), `split point`, NA))
  # prepare data frame for graph
  graph_frame <- data.frame(from = rep(tree$rowname, 2),
                            to = c(tree$`left daughter`, tree$`right daughter`))
  # convert to graph and delete the last node that we don't want to plot
  graph <- graph_from_data_frame(graph_frame) %>%
    delete_vertices("0")
  # set node labels
  V(graph)$node_label <- gsub("_", " ", as.character(tree$`split var`))
  V(graph)$leaf_label <- as.character(tree$prediction)
  V(graph)$split <- as.character(round(tree$`split point`, digits = 2))
  dendro <- as.dendrogram(graph)
  # plot
  plot <- ggraph(graph, layout = 'dendrogram') + 
    theme_bw() +
    geom_edge_elbow() +
    geom_node_point() +
    geom_node_text(aes(label = node_label), na.rm = TRUE, repel = TRUE) +
    geom_node_label(aes(label = split), vjust = 2.5, na.rm = TRUE, fill = "white") +
    geom_node_label(aes(label = leaf_label, fill = leaf_label), na.rm = TRUE, 
                    repel = TRUE, colour = "white", fontface = "bold", show.legend = FALSE) 
  print(plot)
Running this throws the error: 'Error in FUN(X[[i]], ...) : object 'direction' not found'.
