getFileAsBZ2: read a file and (re-) compress it into a bzip2-format raw...

Description Usage Arguments Value Note Author(s)

View source: R/getFileAsBZ2.R

Description

read a file and (re-) compress it into a bzip2-format raw vector

Usage

1
2
getFileAsBZ2(f, ext = stri_extract_last_regex(f, "\\.[A-Za-z0-9]*$"),
  size = file.info(f)$size)

Arguments

f

full path to file. This can be an uncompressed file, or one compressed with gzip (extension must be ".gz") or bzip2 (extension must be ".bz2").

ext

[optional] file extension. If not supplied, the extension is the substring of f beginning with the last period ('.'), for example ".gz". If NA, the file is treated as not compressed.

size

[optional] size of file on disk. If not supplied, it is obtained by a call to file.info

Value

a raw vector of bzip2-compressed data, with attribute "len", giving the length of the uncompressed data.

Note

If the file f is empty, this returns a raw vector of length 0.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


jbrzusto/motusServer documentation built on May 19, 2019, 8:19 a.m.