Learn R Programming

pkglite

A tool, grammar, and standard to represent and exchange R package source code as text files. Converts one or more source packages to a text file and restores the package structures from the file.

  • To get started, see vignette("pkglite").
  • To generate file specifications, see vignette("filespec").
  • To curate file collections, see vignette("filecollection").
  • The text file format is described in vignette("format").

Installation

You can install the package via CRAN:

install.packages("pkglite")

Or, install from GitHub:

remotes::install_github("Merck/pkglite")

Workflow

library("pkglite")

Pack one R package:

"/path/to/package/" %>%
  collate(file_default()) %>%
  pack()

Pack multiple R packages:

pack(
  "/path/to/pkg1/" %>% collate(file_default()),
  "/path/to/pkg2/" %>% collate(file_default()),
  output = "/path/to/pkglite.txt"
)

Unpack one or more packages:

"/path/to/pkglite.txt" %>%
  unpack(output = "/path/to/output/")

Citation

If you use this software, please cite it as below.

Zhao, Y., Xiao, N., Anderson, K., & Zhang, Y. (2023). Electronic common technical document submission with analysis using R. Clinical Trials, 20(1), 89--92. https://doi.org/10.1177/17407745221123244

A BibTeX entry for LaTeX users is

@article{zhao2023electronic,
  title   = {Electronic common technical document submission with analysis using {R}},
  author  = {Zhao, Yujie and Xiao, Nan and Anderson, Keaven and Zhang, Yilong},
  journal = {Clinical Trials},
  volume  = {20},
  number  = {1},
  pages   = {89--92},
  year    = {2023},
  doi     = {10.1177/17407745221123244}
}

Copy Link

Version

Install

install.packages('pkglite')

Monthly Downloads

785

Version

0.2.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Nan Xiao

Last Published

September 25th, 2024

Functions in pkglite (0.2.3)

merge.file_collection

Merge file collections
sanitize_file_collection

Sanitize file collection (deprecated)
unpack

Unpack packages from a text file
print.file_collection

Print a file collection
pkglite-package

pkglite: Compact Package Representations
file_name_patterns

Common File name patterns
file_spec_templates

File specification templates
file_default

File specification (default combination)
ext_text

Common file extensions (text)
file_spec

Create a file specification
file_auto

File specification (automatic guess)
file_ectd

File specification (eCTD submission)
ext_binary

Common file extensions (binary)
sanitize

Sanitize file collection
collate

Evaluate a list of file specifications
remove_content

Remove content lines from a pkglite file
pack

Pack packages into a text file
is_file_collection

Is this a file collection object?
print.file_spec

Print a file specification
prune

Remove files from a file collection
is_file_spec

Is this a file specification object?
%>%

Pipe operator
verify_ascii

Check if a file contains only ASCII characters