sVariable: Global Static Variable

Description Usage Arguments Examples

View source: R/utils.R

Description

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

Usage

1
  sVariable(default = NULL)

Arguments

default

default value for the static variable.

Examples

1
2
3
4
5
6
7
8
9
# 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 2, 2019, 4:42 p.m.