[R] how to get current workspace name?

Duncan Murdoch murdoch at stats.uwo.ca
Sat Mar 24 12:30:37 CET 2007


On 3/24/2007 1:10 AM, Aimin Yan wrote:
> Use getwd(), I can get current directory name.
> 
> Now I want to get current workspace name, Does anyone know how to do that?

It is search()[1].

If you mean instead the name of the file that was loaded on startup, as 
far as I know that's not available in R.  If you mean the default name 
that would be saved on shutdown, that is documented in the save.image() 
man page:  it's .RData in the current directory.

Duncan Murdoch

> 
> here is information about my R
> 
>  > sessionInfo()
> R version 2.4.0 (2006-10-03)
> i386-pc-mingw32
> 
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
> States.1252;LC_MONETARY=English_United 
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] "splines"   "methods"   "stats"     "graphics"  "grDevices" "utils"
> [7] "datasets"  "base"
> 
> other attached packages:
>      nnet    class survival  mlbench     MASS    rpart  RWinEdt
> "7.2-29" "7.2-29"   "2.30"  "1.1-2" "7.2-29" "3.1-32"  "1.7-5"
> 
> Aimin
> 
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list