[R] cant find "get"?

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 1 08:30:24 CEST 2000


>>>>> "JohnS" == Strumila, John <John.Strumila at team.telstra.com> writes:


    JohnS> I found this great function called "get" which allows me to work
    JohnS> out my object name at run time.  Unfortunately it's not letting
    JohnS> me assign values with it.  What am I doing wrong?

     >> names(get(file.name))[1]
     [1] "X14.59.23"
     >> names(get(file.name))[1] <- "date"
     Error: couldn't find function "get<-"

in spite of Thomas' excellent explanation about  `` foo(x) <- .. ''
I wonder if John does not just need to be told
  
     ``	?assign ''

E.g.
	myvar <- "X14.59.23"
	assign(myvar, list("some text", date = date()))

	get(myvar) ## i.e.	X14.49.23	

gives
 [[1]]
 [1] "some text"

 $date
 [1] "Fri Sep  1 08:29:45 2000"


Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list