Learn R Programming

static

Static local variables are initialized once, and then their values are saved for future use.

Installation

You can install the development version of static like so:

remotes::install_github("nfultz/static")

Ye Olde Fibonacci Example

library(static)
fib <- function() {
  
  static(x=1)
  static(y=0)
  static(z=NA)
  z <- x + y 
  x <- y
  y <- z
  
  z
}

Copy Link

Version

Install

install.packages('static')

Monthly Downloads

10

Version

0.1.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

October 10th, 2022

Functions in static (0.1.0)

static-package

Static Local Variables
static

Initialize static local variables.