Fetching contributors…
Cannot retrieve contributors at this time
48 lines (42 sloc) 1.31 KB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reactives.R
\title{Create an object for storing reactive values}
\item{...}{Objects that will be added to the reactivevalues object. All of
these objects must be named.}
This function returns an object for storing reactive values. It is similar to
a list, but with special capabilities for reactive programming. When you read
a value from it, the calling reactive expression takes a reactive dependency
on that value, and when you write to it, it notifies any reactive functions
that depend on that value. Note that values taken from the reactiveValues
object are reactive, but the reactiveValues object itself is not.
# Create the object with no values
values <- reactiveValues()
# Assign values to 'a' and 'b'
values$a <- 3
values[['b']] <- 4
# From within a reactive context, you can access values with:
# If not in a reactive context (e.g., at the console), you can use isolate()
# to retrieve the value:
# Set values upon creation
values <- reactiveValues(a = 1, b = 2)
\code{\link{isolate}} and \code{\link{is.reactivevalues}}.