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

Description Usage Arguments Value Examples

View source: R/tempNameGenerator.R

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

1
2
mk_tmp_name_source(prefix = "tmpnam", ...,
  alphabet = as.character(0:9), size = 20, sep = "_")

Arguments

prefix

character, string to prefix temp names with.

...

force later argument to be bound by name.

alphabet

character, characters to choose from in building ids.

size

character, number of characters to build id portion of names from.

sep

character, separator between temp name fields.

Value

name generator function.

Examples

1
2
3
4
5
6
f <- mk_tmp_name_source('ex')
print(f())
nm2 <- f()
print(nm2)
f(remove=nm2)
print(f(dumpList=TRUE))

WinVector/wrapr documentation built on Oct. 14, 2018, 11:17 p.m.