Skip to content

mean relative differences from all.equal() (PR#9276)

1 message · Marc Schwartz

#
On Wed, 2006-10-04 at 20:22 -0500, Marc Schwartz wrote:
[OFFLIST and PRIVATE]

Brad,

A couple of comments.

First, welcome to R. I hope that you enjoy it and find it of value.

If you are not used to open source software and communities (ie. Linux,
etc.), you will find that this community, unlike commercial paid support
forums, tends to be direct with respect to comments. Don't take it
personally.

Be aware that nobody is getting paid to support R. It is developed and
supported on a voluntary basis by a large body of folks, mainly those
known as "R Core". Some of them have quite literally risked their
academic careers and livelihood to facilitate R's existence.

You will, over time, get a flavor for the nature of the community and
the interchange that takes place. As a result of the voluntary nature of
the community, there is an a priori expectation that you will have put
forth reasonable efforts to avail yourself of the various support
resources before posting. Especially in the case of a bug report, as a
member of R Core has to manually manage the handling and resolution of
bug reports.

A good place to start is to review the R Posting Guide:

http://www.r-project.org/posting-guide.html

which covers many of these issues and how to go about getting support
via the various sources provided.

That all being said, you will find that R's support mechanisms and
resources are second to none and I would challenge any commercial
software vendor to provide a comparable level of support and expertise.

With respect to your specific question above and how the result is
obtained:
[1] 0.0001019608

Here, 'a' is used as the scaling factor, since you only passed single
values. If these were 'vectors' of values, the scaling factor would be
impacted accordingly.

As a result of R's open source nature, you have access to all of the
source code that is R. You can download the source tarball (archive)
from one of the CRAN mirrors, if you so desire.

In this case, the actual function that is used is called
all.equal.numeric(). This is a consequence of how R uses 'dispatch
methods' after a call to a 'generic' function, such as all.equal(). If
you are not familiar with these terms, the available R documentation is
a good place to start, if you should decide to pursue moving into that
level of detail. If you have experience in other programming languages,
this may be second nature already.

In many cases, R's functions are written in R itself. Others are written
in FORTRAN and/or C that is compiled and linked to R via various calling
mechanisms. Since R is an interpreted language, you can have easy access
to many of the functions within the R console.

Thus, at the R command prompt, you can type:
[Note without the parens]

which will then display a representation of the function's source code,
enabling you to review how the function works. If you desire to become a
better R user/programmer, this approach provides a reasonable way to see
how functions are coded and to investigate algorithms and techniques.

I hope that the above is helpful.

Best regards,

Marc