Clearing Console- rm(list=ls(all=TRUE)) not working for me

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clearing Console- rm(list=ls(all=TRUE)) not working for me

YAddo
Dear all again:

I have been trying to clear weeks of codes in my R console, even after quitting and coming back another day!.  One of you out there graciously suggested this  rm(list=ls(all=TRUE)). I tried this but no dice.

Codes tried.

Ctrl +L , clears for the time...  and the the latest i used ...  rm(list=ls(all=TRUE))


Does anybody has another option of clearing the console of old codes?.


Thanks,
YA



Reply | Threaded
Open this post in threaded view
|

Re: Clearing Console- rm(list=ls(all=TRUE)) not working for me

Rolf Turner-3
On 14/04/11 15:21, YAddo wrote:
> Dear all again:
>
> I have been trying to clear weeks of codes in my R console, even after
> quitting and coming back another day!.  One of you out there graciously
> suggested this  rm(list=ls(all=TRUE)). I tried this but no dice.
>
> Codes tried.
>
> Ctrl +L , clears for the time
     Clearing the console is completely different from truncating
     your history.

> ...  and the the latest i used ...
> rm(list=ls(all=TRUE))
Talk about the blind leading the blind! The person who gave you that advice
really doesn't understand much if anything about R.  He/she seems to have no
idea about the distinction between completely distinct concepts.

The
         rm(list=ls(all=TRUE))

command removes *objects* from your workspace. It has nothing whatever to do
with your history of *commands* (``codes'' as you so quaintly put it).

To get rid of past history you can simply edit your .Rhistory file and
delete
all but, say the last 50 lines.

If you want to limit your history so that it never contains more than 50
lines you can do

         Sys.setenv(R_HISTSIZE=50)

This has to be done every time a new R session is started.  I have a similar
command in my .Rprofile so that it gets done automatically.  I use
R_HISTSIZE=5000
however.  I don't really understand why you object to having a fairly
long history
available to you.

     cheers,

         Rolf Turner

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