List defined modules.

list_modules(regexp, reserved = FALSE, wide = TRUE, full = FALSE,
  formatted = TRUE, absolute = FALSE, cols = c("name", "version",
  "storage", "along", "type", "weight", "calls", "dependencies", "uses",
  "size", "lines", "modified"))

lsmod(regexp, reserved = FALSE, wide = TRUE, full = FALSE,
  formatted = TRUE, absolute = FALSE, cols = c("name", "version",
  "storage", "along", "type", "weight", "calls", "dependencies", "uses",
  "size", "lines", "modified"))

Arguments

regexp

A regular expression. If not missing, the regular expression is used to filter the names of the modules to be made.

reserved

A flag. Should special modules with a reserved name be considered?

wide

A flag. Should the function return a data frame instead of a characted vector?

full

A flag. Should all columns be included in the data frame?

formatted

A flag. Should columns with units be string formatted?

absolute

A flag. Should the file paths be absolute?

cols

A character vector. Details returned in the columns of the data frame.

Value

A character vector or a data frame containing module informations.

Details

For each module, the following details can be returned in the columns of the data frame:

name

name.

version

version of the module.

storage

storage of the module, `in-memory` or `on-disk`.

along

name of the on-disk module along which the definition takes place.

filepath

file path of the `on-disk` module.

type

type of the object returned.

weight

memory size of the object.

calls

number of explicit make calls.

dependencies

number of direct dependencies.

uses

number of modules requiring the module.

size

memory size occupied by the definition.

lines

number of lines of the provider.

chars

number of characters of the provider.

duration

duration of the evaluation.

modified

timestamp of last modification.

created

timestamp of creation.

digest

digest (cf. get_digest).

See also

define, make, reset, and touch.

Examples

#> [2018-12-02T17:14:01 CET] Resetting modulr state ... OK
list_modules() define("foo", NULL, function() Sys.sleep(1L))
#> [2018-12-02T17:14:01 CET] Defining 'foo' ... OK
list_modules()
#> name version storage along type weight calls dependencies uses size lines #> 1 foo <NA> in-memory <NA> <NA> <NA> 0 0 0 1.1 Kb 2 #> modified #> 1 2018-12-02T17:14:01 CET
list_modules(reserved = TRUE)
#> name version storage along type weight calls dependencies #> 1 foo <NA> in-memory <NA> <NA> <NA> 0 0 #> 2 modulr#0.1.7.9209 0.1.7.9209 in-memory <NA> <NA> <NA> 0 0 #> uses size lines modified #> 1 0 1.1 Kb 2 2018-12-02T17:14:01 CET #> 2 0 116 Kb 66 2018-12-02T17:14:01 CET
list_modules(reserved = TRUE, wide = FALSE)
#> [1] "foo" "modulr#0.1.7.9209"
invisible(make("foo"))
#> [2018-12-02T17:14:01 CET] Making 'foo' ... #> [2018-12-02T17:14:01 CET] * Visiting and defining dependencies ... #> [2018-12-02T17:14:01 CET] * Constructing dependency graph ... OK #> [2018-12-02T17:14:02 CET] DONE ('foo' in 1 secs)
list_modules(reserved = TRUE, full = TRUE)
#> name version storage filepath url along type weight calls #> 1 foo <NA> in-memory <NA> <NA> <NA> NULL 0 bytes 1 #> 2 modulr#0.1.7.9209 0.1.7.9209 in-memory <NA> <NA> <NA> <NA> <NA> 0 #> dependencies uses size lines chars created #> 1 0 0 1.1 Kb 2 25 2018-12-02T17:14:01 CET #> 2 0 0 116 Kb 66 3165 2018-12-02T17:14:01 CET #> modified duration digest #> 1 2018-12-02T17:14:02 CET 1.000259 a7a826f201a387b4 #> 2 2018-12-02T17:14:01 CET NA 74a025959c822597
list_modules( reserved = TRUE, formatted = FALSE, cols = c("weight", "size", "modified", "created"))
#> name weight size modified created #> 1 foo 0 1104 2018-12-02 17:14:02 2018-12-02 17:14:01 #> 2 modulr#0.1.7.9209 <NA> 118744 2018-12-02 17:14:01 2018-12-02 17:14:01
define("bar", NULL, function() Sys.sleep(1L))
#> [2018-12-02T17:14:02 CET] Defining 'bar' ... OK
define("foobar", list(f = "foo", b = "bar"), function(f, b) NULL)
#> [2018-12-02T17:14:02 CET] Defining 'foobar' ... OK
#> Warning: [2018-12-02T17:14:02 CET] Possibly 2 unused dependencies in ‘foobar’: ‘f’, ‘b’.
invisible(make("foobar"))
#> [2018-12-02T17:14:02 CET] Making 'foobar' ... #> [2018-12-02T17:14:02 CET] * Visiting and defining dependencies ... #> [2018-12-02T17:14:02 CET] * Constructing dependency graph ... OK #> [2018-12-02T17:14:02 CET] * Sorting 2 dependencies with 2 relations ... on 1 layer, OK #> [2018-12-02T17:14:02 CET] * Evaluating new and outdated dependencies ... #> [2018-12-02T17:14:02 CET] ** Evaluating #1/2 (layer #1/1): 'bar' ... #> [2018-12-02T17:14:03 CET] DONE ('foobar' in 1.1 secs)
Sys.sleep(1L) touch("foo")
#> [2018-12-02T17:14:04 CET] Touching 'foo' ... OK
list_modules(".oo.*", cols = c("weight", "size", "modified", "created"))
#> name weight size modified created #> 1 foo <NA> 1.1 Kb 2018-12-02T17:14:04 CET 2018-12-02T17:14:01 CET #> 2 foobar 0 bytes 1.2 Kb 2018-12-02T17:14:03 CET 2018-12-02T17:14:02 CET