Skip to content
Back to formatted view

Raw Message

Message-ID: <458146A7.4000007@sun.ac.za>
Date: 2006-12-14T12:42:15Z
From: Rainer M Krug
Subject: How do I create an object in the Global environment from a	function
In-Reply-To: <OF3BBF1ACA.6F42DA61-ON80257244.0042305F-80257244.004374A7@iop.kcl.ac.uk>

Timothy.Mak at iop.kcl.ac.uk wrote:
> Hi all, 
> 
> Say I have created an object b in my function 
> 
> myfunc <- function() b <- 34

myfunc <- function() b <<- 34
                      ---------

Rainer

> 
> How can I make b an object in the Global environment and not just in the 
> environment of myfunc? 
> 
> Thanks, 
> 
> Tim
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology and Entomology
University of Stellenbosch
Matieland 7602
South Africa

Tel:		+27 - (0)72 808 2975 (w)
Fax:		+27 - (0)86 516 2782
Fax:		+27 - (0)21 808 3304 (w)
Cell:		+27 - (0)83 9479 042

email:	RKrug at sun.ac.za
       	Rainer at krugs.de