Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sVariable

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()

pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.