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 codecov.io

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").

Tools

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 <<-

News

Reference manual

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

install.packages("pryr")

0.1.4 by Hadley Wickham, a year ago


https://github.com/hadley/pryr


Report a bug at https://github.com/hadley/pryr/issues


Browse source code at https://github.com/cran/pryr


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, MSEtool, carrier, ck37r, cooccurNet, dsmodels, flifo, fpmoutliers, gqlr, hIRT, heemod, httping, jstor, kimisc, linear.tools, m2r, mlflow, rbokeh, rmake, rmonad, rsMove, summarytools, trafo.

Suggested by DataSpaceR, Ecfun, R6, functools, gginnards.


See at CRAN