[Rd] small bug in power.t.test for two-sided alternatives (PR#2993)

vangel at nmr.mgh.harvard.edu vangel at nmr.mgh.harvard.edu
Tue May 13 15:12:26 MEST 2003

Full_Name: Mark Vangel
Version: 1.7
OS: FreeBSD 4.4
Submission from: (NULL) (

power.t.test returns a value for whichever of the arguments n, delta, power is
to "NULL".  If one sets the argument alternative='two.sided' (actually, this is
the default), 
then the function takes the absolute value of delta.  Unfortunately, before
the abs value, there is apparently no check for whether delta is NULL, resulting
an error. For example,

Error in abs(delta) : non-numeric argument to function

The arguments delta and alternative are set to their defaults in this example;
omitting them results in the same error.

Yhis is easy to fix by adding the appropriate check, but I thought that I might
as well report it.

    Mark Vangel

More information about the R-devel mailing list