if else statements in R
On Mon, Jun 30, 2003 at 11:21:52AM -0400, Michael Rennie wrote:
W<- function(w)
{
if (comp[i,1]=1) W[i]<-Wo else
"==" is comparison operator, but "=" is assignment one. This code also doesn't work:
x <- 0 if (x = 1)
Error: syntax error But this works:
if (x == 1)
+
Chack also help("=="), help("=")
--
WBR,
Timur.