Learn R Programming

lgr (version 0.4.4)

get_caller: Information About the System

Description

get_caller() Tries to determine the calling functions based on where.

Usage

get_caller(where = -1L)

get_user(fallback = "unknown user")

Value

a character scalar.

Arguments

where

integer scalar (usually negative). Look up that many frames up the call stack

fallback

A fallback in case the user name could not be determined

See Also

base::sys.call()

whoami::whoami()

Examples

Run this code
foo <- function() get_caller(-1L)
foo()
get_user()

Run the code above in your browser using DataLab