Learn R Programming

replyr (version 0.8.2)

makeTempNameGenerator: Produce a temp name generator with a given prefix.

Description

Returns a function f where: f() returns a new temporary name, f(remove=vector) removes names in vector and returns what was removed, f(dumpList=TRUE) returns the list of names generated and clears the list, f(peek=TRUE) returns the list without altering anything.

Usage

makeTempNameGenerator(prefix)

Arguments

prefix

character, string to prefix temp names with.

Value

name generator function.

Examples

Run this code
# NOT RUN {
f <- makeTempNameGenerator('EX')
print(f())
nm2 <- f()
print(nm2)
f(remove=nm2)
print(f(dumpList=TRUE))

# }

Run the code above in your browser using DataLab