module_functions: List the functions associated with a module

View source: R/install.R

module_functionsR Documentation

List the functions associated with a module

Description

Return a vector of functions that can be imported from the module.

Usage

module_functions(repo)

Arguments

repo

Module repo

Value

character

See Also

Other public: is_module_installed(), module_details(), module_help(), module_import(), module_installed(), module_install(), module_search(), module_uninstall()

Examples

library(outsider)
if (is_outsider_ready()) {
  # simplest repo
  repo <- 'dombennett/om..hello.world'

  # is module_installed?
  if (is_module_installed(repo = repo)) {

    # get help for package
    module_help(repo = repo)
    
    # list functions available
    module_functions(repo = repo)
    
    # import
    hello_world <- module_import(fname = 'hello_world', repo = repo)
    
    # get help for function
    module_help(repo = repo, fname = 'hello_world')
    # also works
    ?hello_world

    # run function
    hello_world()
    
    # change verbosity settings
    
    # print nothing to console
    verbosity_set(show_program = FALSE, show_docker = FALSE)
    hello_world()
    
    # print everything to console
    verbosity_set(show_program = TRUE, show_docker = TRUE)
    hello_world()
    
    # write program output to a file
    log_file <- tempfile()
    verbosity_set(show_program = log_file, show_docker = FALSE)
    
    hello_world()
    
    (readLines(con = log_file))
    
    # Clean up
    file.remove(log_file)
  }
}

AntonelliLab/outsider documentation built on June 17, 2022, 3:27 p.m.