I believe the following function is something like what Mark was
looking for.  The previously posted answers to his inquiry were more
of the form ``Do this instead of what you want to do.'' rather than
``Here's how to do what you want to do.''

clean <- function()
{
# Function clean.
        lll <- ls(pos=1)
        for(xxx in lll) {
                pmpt <- paste("remove ", xxx, "? ",sep="")
                ans <- readline(pmpt)
                if(ans == "y")
                        rm(list=xxx, pos = 1)
        }
        invisible()
}

Usage: clean()

                                cheers,

                                        Rolf Turner
                                        [EMAIL PROTECTED]

P. S.  Moral of the story:  If you want to do something in R
and the facility is not built in, it is usually very easy to
roll your own.  Often it's actually easier to roll your own
than to *find* pre-existing facilities.

                                        R. T.

______________________________________________
[email protected] 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.

Reply via email to