Learn R Programming

ascribe

ascribe scans R projects for package and function use. Other packages can use the results to generate citations without maintaining their own parser.

Installation

You can install the development version of ascribe from GitHub with:

# install.packages("pak")
pak::pak("VisruthSK/ascribe")

Example

Build a package universe, then cite the code that uses it:

library(ascribe)

universe <- build_universe_data("stats")
usage <- scan_usage(path, universe)
cite_usage(usage)

Limitations

  • The scanner records function calls, not function references. It ignores lapply(x, mean) and purrr::map(x, sd).
  • Its built-in Markdown parser recognizes R chunks headed with {r}. Plain fenced blocks with an r info string are skipped.
  • Package attachments are tracked within each file. A setup script that calls library() does not establish attachment state for another file.
  • Default package citations require the package to be installed. Supply package_citations for packages that are unavailable locally.
  • Scanning a namespace inspects its bindings for R6 classes. Active bindings can run their getters, and unusually deep generated expressions can exceed R's recursion limits.

Copy Link

Version

Install

install.packages('ascribe')

Version

0.2.0

License

MIT + file LICENSE

Maintainer

Visruth Srimath Kandali

Last Published

August 22nd, 2026

Functions in ascribe (0.2.0)

cite_usage

Cite package and function use in a project
build_export_index

Build an inverted export index
internal_data

Ignored functions/directories used by scanner
resolve_origin

Resolve the origin package of an exported function
collect_pkg_funs

Collect exported functions and R6 methods from a package
generate_universe_sysdata

Generate sysdata.rda for a package universe
build_origin_map

Build an origin map for package functions
build_universe_data

Build scanner data for a package universe
scan_usage

Find used functions and packages
ascribe-package

ascribe: Static Detection and Citation of R Package and Function Usage
collect_r6_methods

Collect R6 class method names from a package