Tools for Computing on the Language

Useful tools to pry back the covers of R and understand the language at a deeper level.

Build Status CRAN_Status_Badge

pryr provides tools to pry back the surface of R and dig into the details. It has been developed in conjunction with "Advanced R programming" to make it easier to understand what's going on in R.

Install it from CRAN with install.packages("pryr").


pryr includes tools to:

  • Make it easier to understand the internal implementation of:

    • promises: uneval(), is_promise(), promise_info()
    • scoping and environments: where(), rls(), parenv()
    • closures: unenclose()
    • calls and expressions: call_tree()
    • primitive types: typenames()
    • copy-on-modify: address(), track_copy()
  • Inspect and understand R's OO systems:

    • Determine which OO system an object belongs to: otype()
    • Determine which OO system a function belongs to: ftype()
  • Make it easier to compute on the language:

    • Alternative ways to create functions: make_function(), f()
    • A version of substitute that uses regular evaluation, substitute_q(), and one that will substitute objects in the global environment, subs()
    • Tools to modify language objects: modify_lang()
    • dots() and named_dots() to get unevaluated ...
    • Partial function evaluation: partial()
    • Find all functions matching some criteria: find_funs()
  • To use existing R tools more easily:

    • %<d-% and %<a-% for creating delayed or active bindings
    • %<c-% for creating constants (locked bindings)
    • rebind as a more user friendly version of <<-


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.4 by Hadley Wickham, 3 years ago

Report a bug at

Browse source code at

Authors: Hadley Wickham [aut, cre] , R Core team [ctb] (Some code extracted from base R)

Documentation:   PDF Manual  

GPL-2 license

Imports stringr, codetools, methods, Rcpp

Suggests testthat

Linking to Rcpp

Imported by KSD, beastier, beautier, bggAnalytics, carrier, cooccurNet, disk.frame, flifo, fpmoutliers, gqlr, hIRT, heemod, httping, jstor, kimisc,, paths, pepr, rbokeh, rmake, rmonad, summarytools, tidycode, trafo, treetop, trimmer.

Suggested by ADtools, DataSpaceR, Ecfun, R6, R6P, RDFTensor, SimRVSequences, altair, functools, genio, gginnards, raveio, threeBrain, tidyfst.

See at CRAN