Skip to content
Back to formatted view

Raw Message

Message-ID: <20030630154724.GA27919@pcf004.jinr.ru>
Date: 2003-06-30T15:47:25Z
From: Timur Elzhov
Subject: if else statements in R
In-Reply-To: <5.1.0.14.0.20030630110610.00a798f0@mail.utm.utoronto.ca>

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.