1

How to save accidentally deleted data into Rstudio environment if you had open copy?

As being shown in the picture below, I want to move "data.hospit.line" into the Global environment that has many other data files. enter image description here I saw a prior post here, but I could not solve it yet as it is a gigantic file.

Mohamed Rahouma
  • 1,084
  • 9
  • 20
  • [this answer](https://stackoverflow.com/questions/39121712/rstudio-save-data-from-viewer?answertab=active#tab-top) lead to [this rstudio help page](https://support.rstudio.com/hc/en-us/community/posts/218065947-Recover-data-from-Viewer-tabs) which I can get to work for: if data is present in the viewer tab, but deleted from the global env then this can be saved as a binary file e.g. `saveRDS(.rs.CachedDataEnv, file="test.rds")` which can then be read in. – user20650 Sep 21 '19 at 14:27

1 Answers1

0

You can select and copy the data from the viewer and paste in excel, save the excel file like a csv and then read the data with read.csv()

JRN
  • 213
  • 1
  • 10
  • Thanks. I tried to use Ctrl C but it is gigantic file and I could not complete that for the whole file despite trying several times. – Mohamed Rahouma Sep 20 '19 at 13:00