Learn R Programming

modules (version 0.9.8)

module_name: Get a module<U+2019>s name

Description

Get a module<U+2019>s name

Usage

module_name(module = parent.frame())

Arguments

module

a module environment (default: current module)

Value

A character string containing the name of the module or NULL if called from outside a module.

Examples

Run this code
# NOT RUN {
cat('This code is always executed.\n')

if (is.null(module_name())) {
    cat('This code is only executed when the module is run
        as stand-alone code via Rscript or R CMD BATCH.\n')
}
# }

Run the code above in your browser using DataLab