Hi there,
I'm struggling with prunning a tree with the function vtree with the vtree package. I created a small example of what I'm trying to do:
library(vtree)
library(tidyverse)
df_world <- tibble(continent = c("Asia", "Asia", "Europe", "Europe", "America"),
country = c("Japan", "China", "Ukraine", "Spain", "Peru"),
pop = c(100, 200, 100, 400, 200),
size = c(200, 300, 400, 500, 600),
sea = c(1, 1, 0, 1, 0))
vtree::vtree(df_world, "sea continent country pop size",
horiz = FALSE)
And I want to cut the blue rectangle in the image below:
But if I use something like:
vtree::vtree(df_world, "sea continent country pop size",
horiz = FALSE,
prunebelow = list(pop = c(200, 100)))
I cut the leafs from other countries.
How can I do this?
Thanks!