extract_archive function

Extract Archive Contents

Extract Archive Contents

Extract contents of an archive to a directory. Requires that the archive package is available.

extract_archive(file, destdir = tempdir())

Arguments

  • file: 'character' string. File path to the archive.
  • destdir: 'character' string. Destination directory to extract files to. It will be created if necessary. Defaults to the temporary directory.

Returns

Invisibly returns the extracted path(s).

Examples

files <- system.file("extdata", "test.zip", package = "inldata") |> extract_archive() unlink(files)

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center