digest_args: digest_args

View source: R/functions_bfcif.R

digest_argsR Documentation

digest_args

Description

returns digest::digest results of named list of arguments to calling function

Usage

digest_args(env = parent.frame(), to_ignore = character(), ...)

Arguments

env

Environment to collect variable from. By default this is the calling environment, i.e. the function containing a call to get_args. This may also be a function that returns an environment.

to_ignore

character names of variables to ignore.

...

Additional variables that should be considered as part of environment.

Value

A md5 digest of all variabes in calling environment. For a function is the same as calling arguments.

Examples

#The most common usage is to simply collect all local variables in a function
test_fun = function(x = 1, y = 2){
  digest_args()
}
test_fun()

#Specified variables may be ignored
test_fun2 = function(x = 1, y = 2){
  digest_args(to_ignore = "x")
}
test_fun2()

#Additional variables can also be added from higher environments
global_z = 3
test_fun3 = function(x = 1, y = 2){
  digest_args(env = parent.frame, to_ignore = character(), z = global_z)
}
test_fun3()

FrietzeLabUVM/ssvQC documentation built on March 25, 2024, 12:24 a.m.