Learn R Programming

diffobj - Diffs for R Objects

Generate a colorized diff of two R objects for an intuitive visualization of their differences.

See the introductory vignette for details.

Output

If your terminal supports formatting through ANSI escape sequences, diffobj will output colored diffs to the terminal. Otherwise, output will be colored with HTML/CSS and sent to the IDE viewport or to your browser. diffobj comes with several built-in color schemes that can be further customized. Some examples:

Installation

This package is available on CRAN.

install.packages("diffobj")
browseVignettes("diffobj")

Related Software

  • tools::Rdiff.
  • Daff diff, patch and merge for data.frames.
  • GNU diff.
  • waldo, which internally uses diffobj for diffs but takes a more hands-on approach to detailing object differences.

Acknowledgements

Copy Link

Version

Install

install.packages('diffobj')

Monthly Downloads

406,569

Version

0.3.6

License

GPL-2 | GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Brodie Gaslam

Last Published

April 21st, 2025

Functions in diffobj (0.3.6)

any,Diff-method

Determine if Diff Object Has Differences
diffObj

Diff Objects
diffCsv

Diff CSV Files
as.character,MyersMbaSes-method

Generate a character representation of Shortest Edit Sequence
as.character,DiffSummary-method

Generate Character Representation of DiffSummary Object
console_lines

Attempt to Compute Console Height in Text Lines
auto_context

Configure Automatic Context Calculation
diffFile

Diff Files
diffChr

Diff Character Vectors Element By Element
diffDeparse

Diff Deparsed Objects
diff_myers

Diff two character vectors
dimnames,PaletteOfStyles-method

Retrieve Dimnames for PaletteOfStyles Objects
finalizeHtml

Finalizing Methods for HTML Output
[,Diff,numeric,missing,missing-method

Subsetting Methods for Diff Objects
diffobj_set_def_opts

Set All diffobj Options to Defaults
diffobj-package

Diffs for R Objects
gdo

Shorthand Function for Accessing diffobj Options
diffStr

Diff Object Structures
diffPrint

Diff printed Objects
diffobj_s4method_doc

Dummy Doc File for S4 Methods with Existing Generics
show,DiffSummary-method

Display DiffSummary Objects
has_Rdiff

Attempt to Detect Whether diff Utility is Available
nchar_html

Count Text Characters in HTML
par_frame

Get Parent Frame of S4 Call Stack
show,PaletteOfStyles-method

Display a PaletteOfStyles
show,Style-method

Show Method for Style Objects
make_blocking

Create a Blocking Version of a Function
guides

Generic Methods to Implement Flexible Guide Line Computations
ses

Shortest Edit Script
pager_is_less

Check Whether System Has less as Pager
strip_hz_control

Replace Horizontal Spacing Control Characters
tag_f

Make Functions That Wrap Text in HTML Tags
summary,MyersMbaSes-method

Summary Method for Shortest Edit Path
summary,PaletteOfStyles-method

Display a Summarized Version of a PaletteOfStyles
trim

Methods to Remove Unsemantic Text Prior to Diff
view_or_browse

Invoke IDE Viewer If Available, browseURL If Not
webfiles

Return Location of Default HTML Support Files
summary,Diff-method

Summary Method for Diff Objects
StyleSummary-class

Styling Information for Summaries
StyleText-class

Character Tokens Used in Diffs
Rdiff_chr

Run Rdiff Directly on R Objects
PaletteOfStyles-class

Class for Tracking Default Styles by Style Type
[<-,PaletteOfStyles-method

Extract/Replace a Style Class or Object from PaletteOfStyles
AlignThreshold-class

Controls How Lines Within a Diff Hunk Are Aligned
Diff-class

Diff Result Object
StyleFuns-class

Functions Used for Styling Diff Components
Pager

Objects for Specifying Pager Settings
Style-class

Customize Appearance of Diff