pack: Pack packages into a text file

View source: R/pack.R

packR Documentation

Pack packages into a text file

Description

Pack packages into a text file

Usage

pack(..., output, quiet = FALSE)

Arguments

...

One or more file collection objects generated by collate().

output

Path to the output text file. If empty, will create a txt file using the lower-cased package name in the current working directory. For multiple packages, will use "pkglite.txt".

quiet

Suppress printing of progress?

Value

The output file path.

Specification

The contents of this section are shown in PDF user manual only.

Examples

# pack two packages
pkg1 <- system.file("examples/pkg1", package = "pkglite")
pkg2 <- system.file("examples/pkg2", package = "pkglite")

fc1 <- pkg1 %>% collate(file_default())
fc2 <- pkg2 %>% collate(file_default())

txt <- tempfile(fileext = ".txt")
pack(fc1, fc2, output = txt, quiet = TRUE)

txt %>%
  readLines() %>%
  head() %>%
  cat(sep = "\n")
txt %>%
  readLines() %>%
  length()

pkglite documentation built on Aug. 29, 2022, 1:05 a.m.