[R] dput() error

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Feb 9 17:09:10 CET 2005


Robin Hankin <r.hankin at soc.soton.ac.uk> writes:

> Hi
> 
> I'm trying to debug one of my functions, which stopped with the
> following message:
> 
> 
> 
> Error in is.vector(x.star) : subscript out of bounds
> 
> 
> So I put a "print(x.star)" statement in just before the is.vector bit
> and got
> 
> 
> Error in print(x.star) : subscript out of bounds
> 
> 
> So I put "dput(x.star)" in and got
> 
> Error in dput(x.star) : subscript out of bounds
> 
> 
> 
> what's going on here?  How best to proceed?

If x.star is an argument to your function, watch out for lazy
evaluation. It could be that *any* use of x.star triggers a faulty
computation in the caller. It might be informative to
print(substitute(x.star))

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




More information about the R-help mailing list