seq_file_ops: seq_file_ops

Description Usage Arguments Value Examples

View source: R/seq_file_ops.R

Description

Quickly create the required number of sequentially labelled files.

Usage

1
seq_file_ops(n, target_dir = NULL, filetype = "R", force = FALSE)

Arguments

n

The number of files to create. Also accepts numerical vector.

target_dir

Directory to create files. Creates the directory if file.exists(target_dir) evaluates to FALSE.

filetype

The suffix to append the filename. Defaults to ".R".

force

Defaults to FALSE. If set to TRUE, seq_file_ops will overwrite any pre-existing files that match the write filenames asked for.

Value

Write a series of sequentially numbered files within a specified directory. Creates the directory if required.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
seq_file_ops(n = 10, target_dir = "munge")

seq_file_ops(n = c(1, 3:8, 10), target_dir = "complex_vector")

# if force == FALSE, pre-existing numbered scripts will not be overwritten
# only 02-.R and 09-.R are written below
seq_file_ops(10, target_dir = "complex_vector")

unlink("munge", recursive = TRUE)
unlink("complex_vector", recursive = TRUE)

ptspotter documentation built on May 3, 2021, 9:07 a.m.