Sowmya S. Manian
Sowmya S. Manian

Reputation: 3833

Name R's Multiple Open Sessions

I have many R sessions open. Searched in Rgui Options, not sure how to name each of the sessions that are open and in use.

enter image description here

Searched in GUI Preferences in R, couldn't get any help. Checked on how to do it with commands, it says each session has its own process ID, to find that used Sys.getpid()

Want to select R session based on name of the R session window.

Upvotes: 2

Views: 206

Answers (1)

G5W
G5W

Reputation: 37641

My version of Windows is displaying the tray icons differently, but I can tell different GUIs apart by setting the Window name using setWindowTitle. For example,

setWindowTitle("Fred")

I get a display like this.

Tray Icons

If you need this to happen automatically, you could generate a random name and stick this statement in your .Rprofile

setWindowTitle(paste0(sample(LETTERS, 3, replace=TRUE), collapse=""))

Upvotes: 3

Related Questions