[R] a problem.

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Jan 2 20:31:00 CET 2008


August Washington wrote:
> I meet a problem about my R code. I find the output of my R code is
> different from the result  several months ago. Do anybody meet this
> situation and how to explain?
> 

  Not me, the square root of 2 is pretty much the same it was last year.

  Possibilities, in the order I'd check them:

  1. You're using pseudo random numbers. runif(10) today is not the same 
as runif(10) five minutes ago. Any analysis that uses random sampling 
will produce different output at some level.

  2. You're running a different script to the one you thought you ran a 
month ago. Or with slightly different parameters.

  3. You're using different data. A tiny change in input could mean a 
large change in output. Maybe this time you've not excluded some 
outliers? How detailed is your logging of what you did a month ago? (I 
have trouble remembering what I did yesterday, but then again that was 
New Year's Day so I have an excuse...).

  4. You're using a different version of R or of a package. It might 
have had a bug fixed which means last month's answers were wrong and 
this month's answers are right. Or it could have had a bug introduced, 
which means last month's answers were right and this month's answers are 
wrong.

  Check these all out, and if you still get different answers... just 
take the average and call it a meta-analysis [joke].

Barry




More information about the R-help mailing list