[R] Changing the value of variables passed to functions as arguments

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Oct 6 09:26:15 CEST 2005


Paul Baer <baer at stanford.edu> writes:

> Is it possible to write functions in such a way that, rather than 
> having to write "a=function(a)", one can just write "function(a)" and 
> have the variable passed as the argument be modified?
> 
> My real interest here is being able to invoke the editor by writing 
> "ed(filename)" rather than filename=edit(filename).

You might want to check out fix()...

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list