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:0x564218f0fea0] <int>
y <- list(x, x, x)
ref(y)
#> █ [1:0x56421ab39378] <list>
#> ├─[2:0x564218f0fea0] <int>
#> ├─[2:0x564218f0fea0]
#> └─[2:0x564218f0fea0]
ref(x, y)
#> [1:0x564218f0fea0] <int>
#>
#> █ [2:0x56421ab39378] <list>
#> ├─[1:0x564218f0fea0]
#> ├─[1:0x564218f0fea0]
#> └─[1:0x564218f0fea0]
e <- new.env()
e$e <- e
e$x <- x
e$y <- list(x, e)
ref(e)
#> █ [1:0x56421868cbf0] <env>
#> ├─x = [2:0x564218f0fea0] <int>
#> ├─y = █ [3:0x56421b227528] <list>
#> │ ├─[2:0x564218f0fea0]
#> │ └─[1:0x56421868cbf0]
#> └─e = [1:0x56421868cbf0]
# Can also show references to global string pool if requested
ref(c("x", "x", "y"))
#> [1:0x56421aa747f8] <chr>
ref(c("x", "x", "y"), character = TRUE)
#> █ [1:0x56421b239bd8] <chr>
#> ├─[2:0x5642149ad950] <string: "x">
#> ├─[2:0x5642149ad950]
#> └─[3:0x564214ad7cb0] <string: "y">
