On Nov 30, 2010, at 1:49 PM, Prof. John C Nash wrote:

I spent more time than I should have debugging a script because I wanted
  x<-seq(0,100)*0.1

but typed
  x<-seq(O:100)*0.1

seq(0:100) yields 1 to 101,
Clearly my own brain to fingers fumble, but possibly one others may want to avoid it.

I discovered some flakey code (that ran without syntactic error and sometimes even without semantic error) that was intended to add a risk estimate from a number of completed years of exposure to a fractional year:

sum(q[1:4] + frac*q[5])

... looked to my brain as sensible, but was actually adding the fractional risk to each of the q[1:4]'s before summation occurred. (Should have been ...

sum(q[1:4] , frac*q[5])

--
David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to