From p.dalgaard at biostat.ku.dk  Sun Mar 13 01:52:28 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Sun Mar 13 01:59:20 2005
Subject: [Rd] Incorrect calculation of loop in R.2.0.1 (PR#7724)
In-Reply-To: <20050313004303.6ACBBC047@slim.kubism.ku.dk>
References: <20050313004303.6ACBBC047@slim.kubism.ku.dk>
Message-ID: <x2r7ik1i5v.fsf@biostat.ku.dk>

iad@columbia.edu writes:

> Full_Name: Ms. Drakes
> Version: 2.01

2.0.1, I guess-

> OS: Windows XP
> Submission from: (NULL) (4.237.32.239)
> 
> 
> file="C:/glob.csv"
> glob=read.csv(file,header=T)
> 
> y=glob$Temperature
> 
> 
> z=max(y[1:40])
> #  this has a probability of exceedance of 1/41 
> # now you can check how this does in the 2nd sample - 
> sum=0
> for i = 41:100 if (z>y[i]sum=sum+1

That's not how you specify a for loop in R. Please read up on the
syntax, e.g. in "An Introduction to R"

> sum
> sum=sum/60
> 	sum
> 
> 
> error: the loop i=41:100 does not work correctly, only if information after "if"
> is enclosed in parentheses

It is not a bug in R that your program does not work correctly. Please
do not abuse the bug report system like that.


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Incorrect calculation of loop in R.2.0.1 (PR#7724)
Peter Dalgaard