On Wed, 2004-05-05 at 17:11, Peter Dalgaard wrote:
> Ulrich Leopold <[EMAIL PROTECTED]> writes:
> 
> > 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?
> 
> Yes, that's not the syntax for a for loop. I have no idea what your
> intention might have been, though.

Ok thanks. I think I misunderstood the example in the help. I think, I
rather need an if function.

I would like to calculate the right hand side if the condition on the
left hand side is met. I am afraid I do not quite understand the syntax.

if(na.omit(sqrt(D))>2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C))))}

Now I get the following warning:
the condition has length > 1 and only the first element will be used in:
if(na.omit(sqrt(D))>2) {


-- 
__________________________________________________

Ulrich Leopold MSc.

Computational Bio- and Physical Geography (CBPG)
Institute for Biodiversity and Ecosystem Dynamics (IBED)
Faculty of Science
University of Amsterdam
Nieuwe Achtergracht 166
NL-1018WV Amsterdam

Room:   B2.52
Phone:  +31 20 525 7456 (7451 Secretary)
Fax:    +31 20 525 7431
Mobile: +31 64 220 3028
Email:  [EMAIL PROTECTED]
URL:    www.science.uva.nl/ibed/cbpg

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to