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 52 53 54 55 56 57 58 59 60 61 62 63
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/futureOf.R
\name{futureOf}
\alias{futureOf}
\title{Get the future of a future variable}
\usage{
futureOf(var = NULL, envir = parent.frame(), mustExist = TRUE,
default = NA, drop = FALSE)
}
\arguments{
\item{var}{the variable. If NULL, all futures in the
environment are returned.}
\item{envir}{the environment where to search from.}
\item{mustExist}{If TRUE and the variable does not exists, then
an informative error is thrown, otherwise NA is returned.}
\item{default}{the default value if future was not found.}
\item{drop}{if TRUE and \code{var} is NULL, then returned list
only contains futures, otherwise also \code{default} values.}
}
\value{
A \link{Future} (or \code{default}).
If \code{var} is NULL, then a named list of Future:s are returned.
}
\description{
Get the future of a future variable that has been created directly
or indirectly via \code{\link{future}()}.
}
\examples{
a \%<-\% { 1 }
f <- futureOf(a)
print(f)
b \%<-\% { 2 }
f <- futureOf(b)
print(f)
## All futures
fs <- futureOf()
print(fs)
## Futures part of environment
env <- new.env()
env$c \%<-\% { 3 }
f <- futureOf(env$c)
print(f)
f2 <- futureOf(c, envir = env)
print(f2)
f3 <- futureOf("c", envir = env)
print(f3)
fs <- futureOf(envir = env)
print(fs)
}
|