[Rd] prompt function confusion (PR#4978)

kwright at eskimo.com kwright at eskimo.com
Fri Nov 7 16:41:29 MET 2003

Full_Name: Kevin Wright
Version: 1.8.0
OS: Windows 2000
Submission from: (NULL) (

(Apologies if this appears multiple times.  Web interface appeared to fail.)

Minor cosmetic issue 

The 'prompt' command contains this:

cat(strwrap(c(paste("Created file named", sQuote(filename),
"in the current directory."), paste("Edit the file and move it to the 
appropriate", "directory."))), sep="\n")

and thus ALWAYS says the file is created "in the current directory", even
when it has created the file elsewhere.

The documentation for 'getwd' says it returns the "current working 

Here is an example:

> getwd()
[1] "x:/"

> prompt(rf,filename="x:/R/rf.Rd")
Created file named 'x:/R/rf.Rd' in the current directory.
Edit the file and move it to the appropriate directory.

A simple fix would be to delete "in the current directory." from the 
prompt function.

A more detailed fix might parse the filename for the existence of a valid 
path.  If no path is included, then say "in the current directory".


Kevin Wright

More information about the R-devel mailing list