dir.check: Checker of output directory

View source: R/dir.check.R

dir.checkR Documentation

Checker of output directory

Description

Checks for the existance of the directories to where the designated file(s) will be output.

Usage

dir.check(filename)

Arguments

filename

Strings. The name of the files you want to save (and thus of whose parent directories you want to create if needed).

Details

While doing your analyses, you may often want several directories to where the output files can be saved. But before saving, you need to first check whether appropriate directory to save outputs already exists. dir.check() automatically does this process by just passing filename(s) you are going to save subsequently. Thus the basic functionality is almost the same to dir.create(basename(x)), but dir.check() accepts multiple filenames and performs some additional path handling.

Value

Strings. Names of the directories that was actually created.

Examples

## Not run: 
f <- "test.eps"
dir.check(f)
eps(f, width = 6, height = 4)
example(htb.colors)
dev.off()

## End(Not run)


keimochizuki/htb documentation built on June 9, 2025, 10:03 p.m.