Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
532 views
in Technique[技术] by (71.8m points)

r - How to get unsaved script tabs

I would like to know, if it is possible to get unsaved script tabs in R studio. I accidentally open and switch to new project, then my unsaved scripts disappeared. Can anyone help to get my unsaved script tabs.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you are on Windows, Go to the folder:

C:Users[your user]AppDataLocalRStudio-Desktopsources

update: since RStudio 1.4.* these sources were moved to:

C:Users[your user]AppDataLocalRStudiosources

the rest of the explanation remains the same.

and if you are on UBUNTU:

home/[your user]/.rstudio-desktop/sources

where there are all of your unsaved tabs in folders, especially those that begin with s like s-******.

There are two kinds of file (eg. D395C3B4 and D395C3B4-contents)
D395C3B4 file contains JSON information about your unsaved tab (eg. "tempName" : "Untitled76") and your correspanding codes are in D395C3B4-contents file.
Open D395C3B4-contents with notepad.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...