powered by
sVariable defines a function that acts as a global static variable.
sVariable
sVariable(default = NULL)
default value for the static variable.
# NOT RUN { # define variable x <- sVariable(1) # get value (default) x() # set new value: return old value old <- x(3) old # get new value x() # }
Run the code above in your browser using DataLab