-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_dir.Rd
28 lines (26 loc) · 1.25 KB
/
check_dir.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{check_dir}
\alias{check_dir}
\title{Check a directory exists}
\source{
This function is taken from the `utils.add' package (https://github.com/edwardlavender/utils.add). It is defined separately in \code{\link[flapper]{flapper}} to reduce reliance on non-default packages.
}
\usage{
check_dir(arg = deparse(substitute(input)), input, check_slash = FALSE)
}
\arguments{
\item{arg}{(optional) A character string which defines the argument of a parent function.}
\item{input}{A character string which defines a directory.}
\item{check_slash}{A logical input that defines whether or not to check the end of the directory string for '/'. If \code{TRUE} and a '/' is lacking, this is added to the returned directory.}
}
\value{
The function checks whether or not a directory exists. If so, the function returns either the directory as inputted, or the directory with a '/' added to the end. If not, the function returns an informative error message.
}
\description{
This function checks whether a directory exists and, if not, returns an informative error message. The inputted directory can be edited with the addition of a '/' if requested.
}
\author{
Edward Lavender
}
\keyword{internal}