Does the input contain a file?

isFile(x)

isAFile(x, nullOK = FALSE)

allAreFiles(x)

Arguments

x

Object.

nullOK

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

Value

logical.

Functions

  • isFile: Vectorized.

  • isAFile: Scalar variant.

  • allAreFiles: Scalar variant.

See also

R.utils::isFile().

getS3method(
    f = "isFile",
    class = "default",
    envir = asNamespace("R.utils")
)

Examples

## TRUE ==== x <- "example.txt" file.create(x)
#> [1] TRUE
isAFile(x)
#> [1] TRUE
unlink(x) ## FALSE ==== isFile(c("~", "."))
#> ~ . #> TRUE TRUE