module_help: Get help for outsider modules

View source: R/install.R

module_helpR Documentation

Get help for outsider modules

Description

Look up help files for specific outsider module functions or whole modules.

Usage

module_help(repo, fname = NULL)

Arguments

repo

Module repo

fname

Function name

See Also

Other public: is_module_installed(), module_details(), module_functions(), 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.