This is like base::search but when used inside a function, it will show the full scope (see figure in the section Binding environments on http://adv-r.had.co.nz/Environments.html). This full search path will be potentially much longer than just search() (which always starts at .GlobalEnv).

searchFullEx shows an example function that is inside this package whose only function is to show the Scope of a package function.

searchFull(env = parent.frame(), simplify = TRUE)

searchFullEx()

Arguments

env

The environment to start searching at. Default is calling environment, i.e., parent.frame()

simplify

Logical. Should the output be simplified to character, where possible

Value

Similar to readLines. It may not return identical results.

Examples

seeScope <- function() { searchFull() } seeScope()
#> [[1]] #> <environment: 0x000000002d3282a8> #> #> [[2]] #> <environment: 0x000000002d327a20> #> #> [[3]] #> <environment: R_GlobalEnv> #> #> [[4]] #> [1] "package:raster" #> #> [[5]] #> [1] "package:sp" #> #> [[6]] #> [1] "package:reproducible" #> #> [[7]] #> [1] "devtools_shims" #> #> [[8]] #> [1] "package:stats" #> #> [[9]] #> [1] "package:graphics" #> #> [[10]] #> [1] "package:grDevices" #> #> [[11]] #> [1] "package:utils" #> #> [[12]] #> [1] "package:datasets" #> #> [[13]] #> [1] "package:methods" #> #> [[14]] #> [1] "Autoloads" #> #> [[15]] #> <environment: base> #>
searchFull()
#> [[1]] #> <environment: 0x000000002d327a20> #> #> [[2]] #> <environment: R_GlobalEnv> #> #> [[3]] #> [1] "package:raster" #> #> [[4]] #> [1] "package:sp" #> #> [[5]] #> [1] "package:reproducible" #> #> [[6]] #> [1] "devtools_shims" #> #> [[7]] #> [1] "package:stats" #> #> [[8]] #> [1] "package:graphics" #> #> [[9]] #> [1] "package:grDevices" #> #> [[10]] #> [1] "package:utils" #> #> [[11]] #> [1] "package:datasets" #> #> [[12]] #> [1] "package:methods" #> #> [[13]] #> [1] "Autoloads" #> #> [[14]] #> <environment: base> #>
searchFullEx()
#> [[1]] #> <environment: namespace:reproducible> #> #> [[2]] #> [1] "imports:reproducible" #> #> [[3]] #> <environment: namespace:base> #> #> [[4]] #> <environment: R_GlobalEnv> #> #> [[5]] #> [1] "package:raster" #> #> [[6]] #> [1] "package:sp" #> #> [[7]] #> [1] "package:reproducible" #> #> [[8]] #> [1] "devtools_shims" #> #> [[9]] #> [1] "package:stats" #> #> [[10]] #> [1] "package:graphics" #> #> [[11]] #> [1] "package:grDevices" #> #> [[12]] #> [1] "package:utils" #> #> [[13]] #> [1] "package:datasets" #> #> [[14]] #> [1] "package:methods" #> #> [[15]] #> [1] "Autoloads" #> #> [[16]] #> <environment: base> #>