[R] how to rest the variables

jim holtman jholtman at gmail.com
Tue Feb 9 20:48:01 CET 2010


What do you mean by 'reset'?  Why not put your processing in a
function that you call so that each time you invoke it, any variables
local to the function start in an 'initialized' state (depends on how
you are using them).  If you need them to have some specific value,
then put in the code necessary since R does not know which ones you
want initialized and which ones you want to keep the value for.  Are
you thinking about some other language that has this feature?  If so
how is it used there?

On Tue, Feb 9, 2010 at 2:02 PM, kayj <kjaja27 at yahoo.com> wrote:
>
> Hi ,
>
> I have several commands that I want to run, I was wondering if there is an
> easy way to reset my variables before the start of each run
>
> for ( i in 1:200){
> reset the variables
> run the commands
> }
>
> My solution right now is to set all my vectors to 0 and my data frames to
> NULL after the start of the loop. Is there an easy way to do this?
>
> Thanks,
>
>
>
>
> --
> View this message in context: http://n4.nabble.com/how-to-rest-the-variables-tp1474869p1474869.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list