sVariable {pkgmaker}R 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.

Examples



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

[Package pkgmaker version 0.22 Index]