Does the input contain a compressed file?

isCompressedFile(x)

isACompressedFile(x, nullOK = FALSE)

allAreCompressedFiles(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.

Details

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

Functions

  • isCompressedFile: Vectorized.

  • isACompressedFile: Scalar.

  • allAreCompressedFiles: Scalar.

Note

Updated 2019-10-22.

See also

Examples

## TRUE ==== x <- c("sample1.fastq.gz", "sample2.fastq.bz2") file.create(x)
#> [1] TRUE TRUE
isCompressedFile(x)
#> sample1.fastq.gz sample2.fastq.bz2 #> TRUE TRUE
unlink(x) ## FALSE ==== x <- c("sample1.fastq", "sample2.fastq") file.create(x)
#> [1] TRUE TRUE
isCompressedFile(x)
#> [1] FALSE FALSE #> Cause: 2 failures #> pos value cause #> 1 1 sample1.fastq no compress ext #> 2 2 sample2.fastq no compress ext