|
|
@@ -24,6 +24,27 @@ print_package <- function(pkg) |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
### Environment |
|
|
|
|
|
|
|
```{r print environment} |
|
|
|
##' Print an environment |
|
|
|
##' |
|
|
|
##' Display the fullname of the environment, |
|
|
|
##' the type, and the name with the size. |
|
|
|
##' @title Print an environment |
|
|
|
##' @param env The environment to print |
|
|
|
##' @return The line to print to the buffer |
|
|
|
print_environment <- function(env) |
|
|
|
{ |
|
|
|
paste0(env, |
|
|
|
"|env| ", |
|
|
|
env, |
|
|
|
" (", |
|
|
|
length(objects(env)), |
|
|
|
")") |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# List objects |
|
|
|
|
|
|
|
## Packages |
|
|
@@ -42,3 +63,23 @@ list_packages <- function() |
|
|
|
USE.NAMES = F, |
|
|
|
simplify = T) |
|
|
|
``` |
|
|
|
## Environments |
|
|
|
|
|
|
|
### List environments |
|
|
|
|
|
|
|
```{r list environments} |
|
|
|
##' List environments |
|
|
|
##' |
|
|
|
##' List environments as returned by `search()`, |
|
|
|
##' but ommiting `ESSR` from ESS, and the `Autoloads` |
|
|
|
##' @title List environments |
|
|
|
##' @return A character vector of environments |
|
|
|
list_environments <- function() |
|
|
|
{ |
|
|
|
sapply(setdiff(search(), c("ESSR", "Autoloads")), |
|
|
|
print_environment, |
|
|
|
USE.NAMES = F, |
|
|
|
simplify = T) |
|
|
|
} |
|
|
|
``` |
|
|
|
|