| Title: | A strong type system for R |
|---|---|
| Description: | A strong type system for R which supports symbol declaration and assignment with type checking and condition checking. |
| Authors: | Kun Ren <[email protected]> |
| Maintainer: | Kun Ren <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1-1 |
| Built: | 2026-05-20 09:07:28 UTC |
| Source: | https://github.com/renkun-ken/rtype |
Declare symbols
declare(..., .envir = parent.frame())declare(..., .envir = parent.frame())
... |
Symbols to declare |
.envir |
|
declare(x,y=numeric(),z=integer())declare(x,y=numeric(),z=integer())
Assign with type checking
atomic(x, ...) <- value integer(x, ...) <- value numeric(x, ...) <- value double(x, ...) <- value logical(x, ...) <- value character(x, ...) <- value raw(x, ...) <- value complex(x, ...) <- value matrix(x, ...) <- value array(x, ...) <- value list(x, ...) <- value pairlist(x, ...) <- value envir(x, ...) <- value name(x, ...) <- value symbol(x, ...) <- value call(x, ...) <- value factor(x, ...) <- value fun(x, ...) <- value expression(x, ...) <- value language(x, ...) <- value object(x, ...) <- value table(x, ...) <- value recursive(x, ...) <- value vector(x, ...) <- value data.frame(x, ...) <- value null(x, ...) <- value check(x, ...) <- valueatomic(x, ...) <- value integer(x, ...) <- value numeric(x, ...) <- value double(x, ...) <- value logical(x, ...) <- value character(x, ...) <- value raw(x, ...) <- value complex(x, ...) <- value matrix(x, ...) <- value array(x, ...) <- value list(x, ...) <- value pairlist(x, ...) <- value envir(x, ...) <- value name(x, ...) <- value symbol(x, ...) <- value call(x, ...) <- value factor(x, ...) <- value fun(x, ...) <- value expression(x, ...) <- value language(x, ...) <- value object(x, ...) <- value table(x, ...) <- value recursive(x, ...) <- value vector(x, ...) <- value data.frame(x, ...) <- value null(x, ...) <- value check(x, ...) <- value
x |
symbol |
... |
additional conditions taking the following forms: 1. 2. 3. a |
value |
value to be assigned |
## Not run: x <- 10L atomic(x) <- 20 numeric(x) <- 10 numeric(x, length = 10L) <- 1:10 cond1 <- function(x) mean(x) <= 5 numeric(x, cond1) <- 0:9 ## End(Not run)## Not run: x <- 10L atomic(x) <- 20 numeric(x) <- 10 numeric(x, length = 10L) <- 1:10 cond1 <- function(x) mean(x) <= 5 numeric(x, cond1) <- 0:9 ## End(Not run)