Skip to content
Prev 292465 / 398500 Next

Assignment problems

That's not the ifelse() that's the for loop returning NULL
(everything's a function!). If you put the assignment inside you'll
get expected behavior.

x <- (for(i in 1:5) i) # Strange
for(i in 1:5) x<- i # Normal (but notice you only get the last value
because previous ones are overwritten)

Michael
On Mon, Apr 23, 2012 at 4:26 PM, phillip03 <phillipbrigham at hotmail.com> wrote: