[R] syntax error in function 'for'

Sundar Dorai-Raj sundar.dorai-raj at PDF.COM
Wed May 5 17:13:47 CEST 2004



Ulrich Leopold wrote:

> Dear list,
> 
> I get a syntax error for the following function:
> 
> for(na.omit(sqrt(D))>2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C))))}
> 
> Any idea what is wrong?
> 
> I am using R 1.8.1 on Linux, Kernel 2.4.21-i686.
> 
> Regards, Ulrich
> 

`na.omit(sqrt(D))>2' is not of the form `var in seq' as the help page 
for `for' would have told you.

Try help("for").

--sundar




More information about the R-help mailing list