Learn R Programming

zonator (version 0.6.0)

check_path: A function to deal with potentially relative paths.

Description

Checks if a path can be resolved (i.e. whether it exists). An additional parameter parent.path can be provided, in which case x is appended to it and the concatenated path is checked for existence. If the path cannot be resolved, raise an error.

Usage

check_path(x, parent.path = NULL, require.file = FALSE)

Arguments

x

Character string path.

parent.path

Character string root path.

require.file

Logical indicating if a file is required for return or if an existing parent folder is enough

Value

A cleaned character string