% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/testr.r
\name{length.generator}
\alias{length.generator}
\title{Returns the length of a generator.

The length of a generator is number of unique values the generator can produce. This only has real meaning for independent generators as dependent generators can have length 1 which gets constantly reevaluated.}
\usage{
\method{length}{generator}(g)
}
\arguments{
\item{g}{Generator whose length is to be determined.}
}
\value{
Length of the generator.
}
\description{
Returns the length of a generator.

The length of a generator is number of unique values the generator can produce. This only has real meaning for independent generators as dependent generators can have length 1 which gets constantly reevaluated.
}
\examples{
length(g(a, 1, 2, 3)) # 3
length(g(b, 1, 2, dependsOn = a)) # 2
length(cg(c, function(i, g, env) { i }, dependsOn = a)) # 1
}
\seealso{
customGenerator, generator
}

