(Ted Harding) <[EMAIL PROTECTED]> writes:
> On 29-Dec-04 dax42 wrote:
> > for(j in 1:length(sequence)-1){
...
> You've fallen into a classic trap: 1:length(sequence)-1 does not
> mean what one might naturally expect.
It might be a good time to warn that 1:(length(sequence)-1) does not
always mean what you might naturally expect either.
seq(length=length(sequence)-1) is safer, and you may in addition want
to safeguard against the case length(sequence)==0.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html