Learn R Programming

rdwd (version 0.7.0)

fileDWD: file management for rdwd

Description

Manage files in the rdwd package. Files are never overwritten but saved with a message as OriginalName_1.file or OriginalName_2.file etc.

Usage

fileDWD(filename, quiet = FALSE, ntrunc = 3, ignore = FALSE)

Arguments

filename

Char (vector): file name(s).

quiet

Logical (vector): Suppress messages about creating file(s)? DEFAULT: FALSE

ntrunc

Integer: Number of filenames printed in messages before they get truncated with message "(and xx more)". DEFAULT: 3

ignore

Logical (vector): Ignore file? Handy in dataDWD. DEFAULT: FALSE

Value

fileDWD returns the input with an added "_n" in the filename if the file already existed.

See Also

dirDWD, dataDWD

Examples

Run this code
# see source code of dataDWD and metaDWD

fns <- c("data", "stupiddummy", "ExampleGraph.png", "rdwd.Rproj", "README.md",
         "stupiddummy.txtdude", "DESCRIPTION", "test_devel.R")
fileDWD(fns)
fileDWD(fns, ignore=TRUE)
fileDWD(fns, ignore=rep(0:1, each=4))
fileDWD(fns, ntrunc=2)
fileDWD("ExampleGraph.png")

Run the code above in your browser using DataLab