Does the input contain a directory?

isDirectory(x)

isADirectory(x, nullOK = FALSE)

allAreDirectories(x)

isDir(x)

isADir(x, nullOK = FALSE)

allAreDirs(x)

Arguments

x

Object.

nullOK

logical(1). If set to TRUE, x may also be NULL.

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isDirectory: Vectorized.

  • isADirectory: Scalar.

  • allAreDirectories: Scalar.

  • isDir: Short alias for isDirectory().

  • isADir: Short alias for isADirectory().

  • allAreDirs: Short alias for allAreDirectories().

Note

Updated 2019-08-08.

See also

Examples

## TRUE ==== isDirectory(c("~", "~"))
#> ~ ~ #> TRUE TRUE
isADirectory("~")
#> [1] TRUE
## FALSE ==== isDirectory(1L)
#> [1] FALSE #> Cause: 'x' is not character.