[R] Warning message in if else statement

From: Monica Pisica <pisicandru_at_hotmail.com>
Date: Wed, 23 Jul 2008 16:05:24 +0000


I am using an if else statement inside a function . If I use that function I have no problems . If I use the function with the if else statement inside a second function I get the following waring:

Warning message:
In if (pval == 0) p_value <- "< 2.2e-16" else p_value <- pval :   the condition has length> 1 and only the first element will be used

Using the second function I get the expected results, with a real p-value even if it is extremely small, or "

[[elided Hotmail spam]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Jul 2008 - 17:19:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 18:32:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive