Description Usage Arguments Value See Also Examples
Compare either the printed or str screen representation of
R objects depending on which is estimated to produce the most useful
diff. The selection process tries to minimize screen lines while maximizing
differences shown subject to display constraints. The decision algorithm is
likely to evolve over time, so do not rely on this function making
a particular selection under specific circumstances. Instead, use
diffPrint or diffStr if you require one or the
other output.
1 |
target |
the reference object |
current |
the object being compared to |
... |
unused, for compatibility of methods with generics |
a Diff object; see diffPrint.
diffPrint for details on the diff* methods,
diffStr,
diffChr to compare character vectors directly
diffDeparse to compare deparsed objects,
ses for a minimal and fast diff
1 2 3 |
< letters > c(letters[1:10], LETTERS[11:26])
@@ 1,4 @@ @@ 1,4 @@
[1] "a" "b" "c" "d" "e" "f" "g" "h" [1] "a" "b" "c" "d" "e" "f" "g" "h"
< [9] "i" "j" "k" "l" "m" "n" "o" "p" > [9] "i" "j" "K" "L" "M" "N" "O" "P"
< [17] "q" "r" "s" "t" "u" "v" "w" "x" > [17] "Q" "R" "S" "T" "U" "V" "W" "X"
< [25] "y" "z" > [25] "Y" "Z"
< str(lm(mpg ~ hp)$qr) > str(lm(mpg ~ disp)$qr)
@@ 3,7 @@ @@ 3,7 @@
~ $ qr : num [1:32, 1:2] -5.657 0.17 ~ $ qr : num [1:32, 1:2] -5.657 0.17
~ 7 0.177 0.177 0.177 ... ~ 7 0.177 0.177 0.177 ...
..- attr(*, "dimnames")=List of 2 ..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:32] "1" "2" "3" "4" .. ..$ : chr [1:32] "1" "2" "3" "4"
... ...
< .. ..$ : chr [1:2] "(Intercept)" "h > .. ..$ : chr [1:2] "(Intercept)" "d
: p" : isp"
..- attr(*, "assign")= int [1:2] 0 ..- attr(*, "assign")= int [1:2] 0
1 1
< $ qraux: num [1:2] 1.18 1.08 > $ qraux: num [1:2] 1.18 1.09
$ pivot: int [1:2] 1 2 $ pivot: int [1:2] 1 2
$ tol : num 1e-07 $ tol : num 1e-07
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.