Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/reactiveSource.r
Creates a reactive source object that can be used by
observable reactive objects created via setShinyReactive
or reactive
.
1 2 | reactiveSource(id, value = NULL, where = parent.frame(), overwrite = TRUE,
typed = FALSE, strict_set = c(0, 1, 2), ...)
|
id |
|
value |
|
where |
|
overwrite |
|
typed |
|
strict_set |
|
Further |
arguments to be passed to subsequent functions.
In particular:
|
This is a slightly modified version of makeReactiveBinding.
ANY
. The value of value
.
Janko Thyson janko.thyson@rappster.de
http://github.com/Rappster/reactr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ## Not run:
## Create reactive source //
reactiveSource(id = "x_1", value = 10)
x_1
x_1 <- 20
x_1
## No overwrite //
reactiveSource(id = "x_1", value = 10)
x_1
reactiveSource(id = "x_1", value = 20, overwrite = FALSE)
x_1
## --> as `x_1` already existed with a non-NULL value and `overwrite = FALSE`,
## no overwrite has been performed
##------------------------------------------------------------------------------
## Typed //
##------------------------------------------------------------------------------
## Basics //
## Strict = 0:
(reactiveSource(id = "x_1", value = 10, typed = TRUE))
x_1 <- "hello world!"
x_1
## --> simply ignored
## Strict = 1:
(reactiveSource(id = "x_1", value = 10, typed = TRUE, strict = 1))
try(x_1 <- "hello world!")
x_1
## --> ignored with warning
## Strict = 2:
(reactiveSource(id = "x_1", value = 10, typed = TRUE, strict = 2))
try(x_1 <- "hello world!")
x_1
## --> ignored with error
## Advanced //
(reactiveSource(id = "x_1", typed = TRUE, from_null = FALSE, strict = 2))
try(x_1 <- "hello world!")
(reactiveSource(id = "x_1", value = 10, typed = TRUE, to_null = FALSE, strict = 2))
try(x_1 <- NULL)
(reactiveSource(id = "x_1", value = 10, typed = TRUE, numint = FALSE, strict = 2))
try(x_1 <- as.integer(10))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.