Re: [R] Can't there be a cd command?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu 11 May 2006 - 00:30:35 EST

On 5/10/2006 10:11 AM, Liaw, Andy wrote:

> From: Paul Johnson

>>
>> It is a FAQ in our Linux lab. People start emacs and fire up
>> R via ess, and then they have no idea 'where they are". For
>> computer experts, it is not a problem, but for people who
>> don't know much about computers, it is a pretty big problem.
>> They have data in some subdirectory, but almost invariably
>> they don't get emacs & R started from that same place.
> 
> ESS by default will prompt for start-up directory when starting 
> R.  Perhaps that was turned off in the lab?
> 
>  

>> Unfortunately, for our users, it does not help to simply
>> re-label setwd as cd. Both commands imply a deeper
>> understanding of the OS than they have. Also, unfortunately,
>> these are the same people who don't understand that FAQs
>> exist and should be consulted. These people are so new/timid
>> that asking in r-help would be the last thing to cross their mind.
>>
>> I've wondered if it would not help to have the R prompt
>> include the directory name, as in an x terminal.
> 
> Here's one possibility (on WinXP Pro):
> 

>> h <- taskCallbackManager()
>> h$add(function(expr, value, ok, visible) {
> +     options(prompt=paste(getwd(),"> ", sep=""))
> +     return(TRUE)}, name="pwdprompt") 
> [1] "pwdprompt"
> C:/home > setwd("projects")
> C:/home/projects > 

That doesn't quite work in the current Rgui, because the menu function to change directories (File | Change dir...) doesn't trigger the callback. Not sure if that's a bug or not...

Duncan Murdoch



R-help@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 Received on Thu May 11 00:34:04 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 11 May 2006 - 02:10:07 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.