xg_unzip: Unzip an xlsx

Description Usage Arguments Value Examples

View source: R/xg_unzip.R

Description

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

Usage

1
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

1
2
3
4
5
6
file.copy(xg_example("datasets"), "datasets.xlsx")
xg_unzip("datasets.xlsx")

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

Zombie-Technology/ER documentation built on Dec. 31, 2020, 6:36 p.m.