[R] Beginner's question about t.test()

Rolf Turner rolf at math.unb.ca
Sun Feb 15 16:23:26 CET 2004


(a) You don't really need/want to look at t.test.default; your own
code --- to do t tests based on summary statistics rather than data
--- will have little or nothing to do with the code in
t.test.default.  Just write code to do the t test ``as if you were
doing it by hand'' which is very simple and straightforward.

(b) The reason that you can't ``see'' the t.test.default code is the
namespace business on which I recently wrote a perhaps ill-advised
rant to this list.

It was gently pointed out to me that the namespace idea certainly
does have its uses and advantages.  It was also pointed out that you
CAN get at functions which are ``hidden away'' by the namespace
mechanism.  Three ways (of which I was kindly informed by Andy Liaw
and Duncan Murdoch) are:

	> ctest:::t.test.default
	> getAnywhere("t.test.default")
	> getS3method("t.test","default")

Hope this helps.

					cheers,

						Rolf Turner
						rolf at math.unb.ca




More information about the R-help mailing list