This tree display focusses on the distinction between names and values. For each reference-type object (lists, environments, and optional character vectors), it displays the location of each component. The display shows the connection between shared references using a locally unique id.
Examples
x <- 1:100
ref(x)
#> [1:0x63db26bf5388] <int>
y <- list(x, x, x)
ref(y)
#> █ [1:0x63db29ca52b8] <list>
#> ├─[2:0x63db26bf5388] <int>
#> ├─[2:0x63db26bf5388]
#> └─[2:0x63db26bf5388]
ref(x, y)
#> [1:0x63db26bf5388] <int>
#>
#> █ [2:0x63db29ca52b8] <list>
#> ├─[1:0x63db26bf5388]
#> ├─[1:0x63db26bf5388]
#> └─[1:0x63db26bf5388]
e <- new.env()
e$e <- e
e$x <- x
e$y <- list(x, e)
ref(e)
#> █ [1:0x63db25b56c48] <env>
#> ├─x = [2:0x63db26bf5388] <int>
#> ├─y = █ [3:0x63db2929a5a8] <list>
#> │ ├─[2:0x63db26bf5388]
#> │ └─[1:0x63db25b56c48]
#> └─e = [1:0x63db25b56c48]
# Can also show references to global string pool if requested
ref(c("x", "x", "y"))
#> [1:0x63db292d9988] <chr>
ref(c("x", "x", "y"), character = TRUE)
#> █ [1:0x63db292b8558] <chr>
#> ├─[2:0x63db2335ff30] <string: "x">
#> ├─[2:0x63db2335ff30]
#> └─[3:0x63db2346f978] <string: "y">
