file_set: Generate a sequence of file objects

View source: R/stream-file.R

file_setR Documentation

Generate a sequence of file objects

Description

File names have a numbered core that communicates the current file number as well as the total number of files in the set. For example, 02-20 would indicate the second file in a set of 20. Other customizations can be added.

Usage

file_set(n, where = NULL, prefix = NULL, pad = TRUE, sep = "-", ext = "")

Arguments

n

The number of file names to create.

where

An optional output file path.

prefix

A character prefix for the file name.

pad

If TRUE, numbers will be padded with zeros.

sep

Separator character.

ext

A file extension, including the dot.

Value

By default a list length n of lists length 2; each sublist contains the integer file number as i and the file name as file.

See Also

setup_locker()

Examples


x <- file_set(3, where = "foo/bar")
length(x)
x[2]

x <- file_set(25, ext = ".feather")
x[17]


mrgsim.parallel documentation built on March 18, 2022, 7:52 p.m.