[Rd] variables in nls (PR#829)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
28 Jan 2001 16:22:17 +0100


Uwe Ligges <ligges@statistik.uni-dortmund.de> writes:

> Looks like a problem (?) with all.vars():
> 
>  temp <- matrix(1:4, 2)
>  all.vars(temp ~ 3) # OK
> [1] "temp"
> 
>  all.vars(temp[1, ] ~ 3) # Here is the problem. 
> [1] "temp" ""
> 
>  all.vars(temp[1, TRUE] ~ 3) # works again
> [1] "temp"
> 
> 
> If this is expected (?), because of an implicitly given empty variable
> name ([1, ThisOne]) for example, nls() has to be fixed:
> 
> 
> Just insert after the lines
>  
>   varNames <- varNames[is.na(match(varNames, names(start),
>         nomatch = NA))]
> 
> the line 
> 
>   varNames <- varNames[varNames != ""]

Thanks for the workaround, Uwe. In the longer run it is probably
better to make all.vars skip empty variable names.
-- 
   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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._