Skip to content

getting the name of the working .Rdata file

2 messages · vito muggeo, Duncan Murdoch

#
dear all,
I do not if it is a nonsense question..

Is it possible in the R session to get the name of the current .Rdata 
file that I ran?

I mean: suppose I double click the file myfile.Rdata. ls() returns the 
names of the objects in the current workspace (that is saved in 
myfile.Rdata). In the current R session, I would like to obtain 
"myfile.Rdata". Is it possible?

Thanks in advance,
vito
#
On 12-06-01 5:05 AM, Vito Muggeo (UniPa) wrote:
The workspace name per se isn't saved in a place accessible to the user, 
but the whole command line is available if you look at commandArgs(). 
However, there are other ways to load and change workspaces, so you 
shouldn't count on the command line staying relevant through the whole 
session.

Duncan