Skip to contents

Does the input contain a directory?

Usage

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 2023-09-29.

Examples

## TRUE ====
isDirectory(c("~", "."))
#> [1] TRUE TRUE
isADirectory("~")
#> [1] TRUE

## FALSE ====
isDirectory(1L)
#> [1] FALSE