objdiff(x, y, file=tempfile("diff"), command="diff -c")
file
is not missing,
file
, otherwise the exit status of
command
(multiplied by 256).
file
.
x
and
y
are written to temporary files in the deparse format produced
by
dump
. Then
command
is passed the names of these two files, and
its output is sent to
file
. A pager is started on
file
with the
S-PLUS function
page
.
This function is unrelated to
diff
, which computes numerical differences
with time series data.
myfun.old <- function(x) { apply(x, 2, mean) } myfun.new <- function(x) { apply(x, 2, median) } objdiff(myfun.old, myfun.new) # write the diff on "myfun.diff" and don't remove it: objdiff(myfun.old, myfun.new, "myfun.diff") # write the diff on a new temp. file, and don't remove it: objdiff(myfun.old, myfun.new, tempfile()) # compare an object with the same name on different databases: stdev <- function(x) sqrt(var(x)) objdiff(get("stdev", where=2), get("stdev", where=1)) rm(stdev)