xg_unzip: Unzip an xlsx

View source: R/xg_unzip.R

xg_unzipR Documentation

Unzip an xlsx

Description

Extracts the files from an xlsx zip archive. Note it will overwrite existing files, so plan accordingly.

Usage

xg_unzip(path, exdir = NULL)

Arguments

path

Character, length one. Path to xlsx file.

exdir

Passed to utils::unzip(). Directory in which to unpack the xlsx. By default, if unpacking foo.xlxs, this will be foo/ in the same directory as foo.xlsx.

Value

The path to the top-level directory of the unpacked xlsx, invisibly.

Examples

file.copy(xg_example("datasets"), "datasets.xlsx")
xg_unzip("datasets.xlsx")

## clean up
unlink("datasets", recursive = TRUE)
file.remove("datasets.xlsx")

jennybc/excelgesis documentation built on July 29, 2023, 4:31 a.m.