sVariable: Global Static Variable

View source: R/utils.R

sVariableR Documentation

Global Static Variable

Description

sVariable defines a function that acts as a global static variable.

Usage

sVariable(default = NULL)

Arguments

default

default value for the static variable.

Value

A function that can be used to set/get the static variable.

Examples


# define variable
x <- sVariable(1)
# get value (default)
x()
# set new value: return old value
old <- x(3)
old
# get new value
x()


pkgmaker documentation built on May 3, 2023, 5:08 p.m.

Related to sVariable in pkgmaker...