check-vector-isCompressedFile: Does the input contain a compressed file?

check-vector-isCompressedFileR Documentation

Does the input contain a compressed file?

Description

Does the input contain a compressed file?

Usage

isCompressedFile(x)

isACompressedFile(x, nullOk = FALSE)

allAreCompressedFiles(x)

Arguments

x

Object.

nullOk

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

Details

Currently only performs a simple check, based on file extension match.

Value

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

Functions

  • isCompressedFile(): Vectorized.

  • isACompressedFile(): Scalar.

  • allAreCompressedFiles(): Scalar.

Note

Updated 2023-09-29.

See Also

  • isFile().

  • compressFileExt.

Examples

## TRUE ====
x <- c("sample1.fastq.gz", "sample2.fastq.bz2")
invisible(file.create(x))
isCompressedFile(x)
unlink(x)

## FALSE ====
x <- c("sample1.fastq", "sample2.fastq")
invisible(file.create(x))
isCompressedFile(x)
unlink(x)

steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.