This function retrieves metadata about files in an archive, it can be passed to archive_read() or archive_write to create a connection to read or write a specific file from the archive.

archive(file, options = character())



File path to the archive.


character() default: character(0) Options to pass to the filter or format. The list of available options are documented in options can have one of the following forms:

  • option=value The option/value pair will be provided to every module. Modules that do not accept an option with this name will ignore it.

  • option The option will be provided to every module with a value of "1".

  • !option The option will be provided to every module with a NULL value.

  • module:option=value, module:option, module:!option As above, but the corresponding option and value will be provided only to modules whose name matches module. See read options for available read options See write options for available write options


@return A tibble with details about files in the archive.

See also

archive_read(), archive_write() to read and write archive files using R connections, archive_extract(), archive_write_files(), archive_write_dir() to add or extract files from an archive.


a <- archive(system.file(package = "archive", "extdata", ""))
#> # A tibble: 3 × 3
#>   path            size date               
#>   <chr>          <int> <dttm>             
#> 1 iris.csv         192 2017-04-28 19:55:29
#> 2 mtcars.csv       274 2017-04-28 19:55:29
#> 3 airquality.csv   142 2017-04-28 19:55:29