Re: [R] "export" an object froma function for access by ls()

About this list Date view Thread view Subject view Author view Attachment view

From: Martin Maechler (maechler@stat.math.ethz.ch)
Date: Thu 24 Apr 2003 - 19:36:53 EST


Message-id: <16039.45109.690685.290835@gargle.gargle.HOWL>


>>>>> "DavidA" == David Andel <andel@ifi.unizh.ch>
>>>>> on 24 Apr 2003 09:40:48 +0200 writes:

    DavidA> I struggle with this very simple problem:

    DavidA> ls()
    DavidA> (empty)

    DavidA> giveval <- function() {
    DavidA> x <- foo
    DavidA> eval (x, envir=parent.frame(1))
    DavidA> }

    DavidA> ls()
    DavidA> (still empty)
probably not.
At least "giveval" should be there..

    DavidA> I did not find anything more promising than eval for
    DavidA> this purpose, but how only can I make it to have
    DavidA> ls() return x?

Use assign() instead of eval() ==> ?assign

{interesting to hear that computer scientists "across the street"
 here in Zurich are going into using R !!}

Vill Glück,
Martin

Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27
ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND
phone: x-41-1-632-3408 fax: ...-1228 <><

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:43 EST