|
|
@@ -1,3 +1,44 @@ |
|
|
|
--- |
|
|
|
title: R object browser functions |
|
|
|
--- |
|
|
|
|
|
|
|
# Description |
|
|
|
|
|
|
|
## Print |
|
|
|
|
|
|
|
### Package |
|
|
|
|
|
|
|
```{r print package} |
|
|
|
##' Print a package |
|
|
|
##' |
|
|
|
##' Display the fullname of the package, |
|
|
|
##' the type, and the name with the size. |
|
|
|
##' @title Print a package |
|
|
|
##' @param pkg The package to print |
|
|
|
##' @return The line to print to the buffer |
|
|
|
print_package <- function(pkg) |
|
|
|
{ |
|
|
|
paste0(pkg, |
|
|
|
"|pkg| ", |
|
|
|
pkg) |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# List objects |
|
|
|
|
|
|
|
## Packages |
|
|
|
|
|
|
|
### List packages |
|
|
|
|
|
|
|
```{r list packages} |
|
|
|
##' List packages |
|
|
|
##' |
|
|
|
##' List all the installed packages |
|
|
|
##' @title List packages |
|
|
|
##' @return A character vector of packages |
|
|
|
list_packages <- function() |
|
|
|
sapply(row.names(installed.packages()), |
|
|
|
print_package, |
|
|
|
USE.NAMES = F, |
|
|
|
simplify = T) |
|
|
|
``` |