Recover data from hard drive r studio. How to work with R-STUDIO program

Surely many users in their lives have faced unpleasant situations when, having deleted files from the trash bin or using the Shift + Del command to erase them, they suddenly realized with horror that they had done something wrong ... If any then there are unimportant documents, then there is nothing wrong with that, but if a scientific work on which you have been working for more than one day "burned out", it is not far before a nervous breakdown.

However, there is no need to panic: R-Studio will help you. How to use it will be discussed in this article.

To begin with, this application is the brainchild of talented Canadian programmers. Millions of users around the world have already experienced its benefits and now warmly thank the creators, as this small utility can do real miracles.

But even from R-Studio (we will tell you how to use the program) there is no need to expect something outstanding in such cases:

  • you deleted an important file, but continued to use the computer for a week or two;
  • a couple of times formatted the hard drive or flash drive containing the deleted document;
  • installed several programs or a large game on the same hard drive;
  • the file you were looking for was deleted by the antivirus because it was infected with malware.

It is strongly discouraged to admit such situations, since in this case no service center can help you! So R-Studio. How to use?

First things first, you need to install it. Attention! Never install it on the same disk from which the document you need was deleted! For example, if important photos have been erased from the "C" drive, put it on the "D" drive. After launching the application, you will see its dialog box. On its left side there are all disks that are defined and installed in the system.

Remember: before using R-Studio, connect the damaged hard disk or flash drive! There are times when users do not even understand this, hoping to find the information they need in a completely different place.

So, we click on the disk we need with the left mouse button. Its tree structure is revealed, in which all the folders available there are visible. Having selected the desired one (a green square will appear next to it), click on the Recover button. A dialog box for selecting a recovery path will open.

If you do not understand anything about such matters, it is better not to change the path suggested by the program, but write down or remember it to search for the saved files. Don't worry: R-Studio 63 (which we almost learned how to use) stores such objects in My Documents / RTT.

After choosing the path, click on the OK button and patiently wait for the end of the process. After that, go to the above path and enjoy the returned files.

Note that the search process can take a long time, and to a large extent, the duration of this process depends on the power of your computer. Remember that in the course of the search, in no case should you turn off the computer or forcibly terminate the program, since you absolutely do not need extra disk records in such a situation!

This is what an R-Studio application is all about. You already know how to use it!

It is a program that is used to recover deleted files. Let's start with the fact that you can recover only those files that have not been replaced by others. That is, after deleting a file, only its header is erased, and the system stops seeing it. But physically, the file is still on the hard drive. However, now the system is not in its place can write other data. And so, as long as the data has not been overwritten, the file can be restored. As soon as new files have been written, you will no longer be able to recover your deleted data, and if you can, they will be damaged and unreadable. Damaged files can sometimes be recovered, but this is already done by specialists in computer labs, and this issue is beyond the scope of this article.

So, since we cannot write new files in place of the deleted ones, the following rule arises. If you inadvertently deleted data or formatted the entire media, then you should immediately stop any work on the computer. The longer you keep working, the lower your chances of a successful recovery will be.

Now, in fact, about the R-Studio program. I have seen on the Internet the opinion that the program is intuitive, but this is far from the case, there are also more understandable programs to learn. Thank God that at least the Russian language was screwed, otherwise many would have problems. So, let's begin.

At the installation stage, R-Studio recommends not to install the program on the disk partition where the data was deleted. This is again due to the fact that the program writes its files to the hard drive during installation, and can itself damage your data. Indeed, even if the files are written to a different folder, then the hard disk does not know where these files will be placed. There is no such folder structure, and new files can be written to any vacant place. Therefore, in order to reduce the number of operations on the affected section, even R-Studio should not be put in this section.

Select the partition and click the "Show disk contents" button.

Searching for files ...

All folders in this section of the disk are displayed, including several folders marked with a cross. This means that some folders were found that were deleted. Folders can be opened by double-clicking and viewing their contents in the pane on the right. Select the desired folder or several folders and press the "Restore" button

Select the folder to restore. It is not recommended to restore to the same partition, so we select a folder on a different drive.

We go to the folder where the files were restored and check what we managed to get back. The screenshots show a folder shared for a virtual operating system, ignore the strange path.

Now let's look at a more in-depth method. Select the desired disk partition and click on the scan button. This operation performs a more thorough search for files, but it takes much longer (it can take an hour or more).

As a result, we get some found files. This method can be useful in cases where the first method did not help. The most reliable files to recover are marked in green. Most likely these will be recently deleted files. Folders and files marked in green can be recovered without problems.

There are also folders marked in yellow and green. Recovery of such data is questionable. Here you can find files that you have already forgotten about.

Double click to open one of the found folders, select the data in it and press the "Restore" button.

Select the folder for recovery again and check what we got.

Well, we have reviewed the process of recovering deleted files using the R-Studio program.

R-STUDIO allows you to recover file system data. Used when unintentionally deleting files, after reinstalling the operating system or rebuilding RAID arrays, and JBOD. The program can be used for virtualization platforms.

Data recovery from R-STUDIO

  • The result of the scanning process is a color map, on which green means the found file system and Bootsector.
  • Orange - The file system is defined, but the boot sector is missing.
  • Red - Boot sector detected, no file systems.

4. To open a structure, just double-click on the map. The structure clearly shows the folders and their associated files.

Overwriting information on a new media

  1. To overwrite to third-party media, you need to select all folders and files. Calling the context menu, select " Recover Marked". AT " Output Folder»Specify the location to save the data. It is important not to save information to the disk being recovered. For conflicts with files, you can use the "Rename" option. For hidden attributes, it is possible to delete or prompt for user action on each discovery.
  2. Software developer R-STUDIO warns that not always the result of work can be purely positive. In some cases, files are restored with errors.

Video: R-Studio - Recover Deleted Files

From the official website of the project. RStudio can be installed on both a personal computer and a Linux-managed server. Below we are talking about a version of the program for personal computers.

RStudio installers are available for all the most common operating systems, in particular Windows XP / Vista / 7, Mac OS X 10.5, Debian 6 + / Ubuntu 10.04 and Fedora 13. Select the appropriate file from the list and download it. The installation takes place in a standard manner, without any special features.

2. Working with the Console

2.1. general information

RStudio Console provides a number of options to make working with R simple and productive. Mastering these options, along with the capabilities available in the Source and History panels, can more than reward the learning curve.

2.2. Auto code completion

RStudio supports automatic code completion using the Tab key. For example, if you have an object named pollResults in your workspace, you can type poll, press Tab, and RStudio will automatically complete the name of that object. Similarly, you can get hints on functions when you enter their names. For example, typing the function name sub and pressing Tab gives the following:

Code completion also works for function arguments; for example, if you enter subset (and press Tab, we get:

2.3. Returning to previous commands

When working with R, it is constantly necessary to re-execute one or another command that has already been executed earlier. Like the standard R console, the RStudio console supports the ability to navigate through previously executed commands using the arrow keys.

You can also use the keyboard shortcut Ctrl + Up (Command-Up on Mac computers) to view a list of recently executed commands and to select a specific command from that list:

The same keyboard shortcut is also suitable for quickly finding previously called functions that have a specific prefix in their names. For example, to find functions that have plot in their name, just type plot and press Ctrl + Up:

2.4. Console window title

There are several additional options in the Console title bar:

  • Displaying the working directory.
  • Ability to interrupt ongoing calculations.
  • Minimizing and maximizing the Console window in relation to the Code Editor panel (Source) (using the buttons in the upper right corner or double-clicking on the window title).

2.5. Hotkeys

Ctrl + L - Clears the Console window of text

Esc - interrupts calculations

3. Editing and executing code

3.1. general information


The RStudio code editor includes a number of options for productive work, in particular, code highlighting, automatic code completion, editing multiple files at the same time, finding and replacing specific parts of the code.

In addition, RStudio has the flexibility to execute code directly from the editor window. For many users, this is the preferred way of working with R. Running commands from the Code Editor window instead of the Console command line makes it easier to play the same commands and allows you to "package" such commands into one function for later use.

3.2. File management


RStudio supports syntax highlighting and other specialized code options for the following file types:

  • R scripts
  • sweave docs
  • teX documents
To create a new file use the File -\u003e New menu:

To open an existing file, use the File -\u003e Open or Open Recent menu (to open a file that you have worked with recently). If several files are open at the same time, a quick transition from one document to another is performed using the corresponding tabs at the top of the code editor window. To navigate between a large number of open files, use the \u003e\u003e icon in the upper right part of the Editor window; you can also use the View -\u003e Switch to menu.



3.3. Code completion

As noted above when working with the Console, RStudio supports automatic code completion using the Tab key. For example, if you have an object named pollResults in your workspace, you can type poll, press Tab, and RStudio will automatically complete the name of that object.


3.4. Finding and replacing parts of code

In the RStudio Code Editor, you can find and replace parts of the text you want. To perform this operation, you must use the shortcut keys Ctrl + F or the menu section Edit -\u003e Find and Replace. There is a magnifying glass button at the top of the editor window - clicking it also opens a dialog box where you can set search parameters.



3.5. Automatic function creation

The RStudio code editor can analyze the selected part of the text and automatically convert it into a function for subsequent reuse. All "free" variables in the selected code (i.e. objects that are referenced but not created inside the selection) will be converted to function arguments:

3.6. Code commenting

To comment out the highlighted parts of the code (or to uncomment), use the Edit -\u003e Comment / Uncomment Lines menu item (see also the figure below):

3.7. Code execution

RStudio supports executing code directly from the Editor window (the executed commands are sent to the Console, where the result of their execution also appears).

To execute the current line of code, you can use the Ctrl + Enter key combination or the Run Line (s) button located at the top of the Editor window:


There are two possibilities for executing multiple lines of code at the same time:

  • Select the required lines and press Ctrl + Enter (or use the Run Line (s) button located in the upper part of the Editor window);
  • Press Ctrl + Shift + Enter to execute all lines in the script.

3.8. Hotkeys

Ctrl + Shift + N - create a new document

Ctrl + O - open document

4. Code navigation

4.1. general information

RStudio includes a number of options for quick navigation through R code. Learning about these options can lead to significant efficiency gains as well as a better understanding of code written by others.

4.2. Go to a file or function

If you know the name of the script file or the name of the function, you can quickly find it using the Go to File / Function search box in the main RStudio toolbar:


The "Go to File / Function" option works by constantly indexing the code you create. The specific files to be indexed are defined as follows:

  • If any RStudio project is active: all files located in the folder of this project are indexed;
  • If the project is not active: all open files with R scripts are indexed.

Hotkeys for calling the Go to File / Function option: Ctrl +

4.3. Go to function definition

By constantly indexing the R code (see above), RStudio can also help you find the definition of any function. To go to the code of a function, hover the cursor over its name (it is not necessary to select it completely) and select the Go to Function Definition command:

You can also jump to the function definition in the following ways:

  • Using the hotkey F2.
  • Using Ctrl + click on the function name.
  • Using the Code Editor or Console.

You can navigate to defining not only your own functions, but also functions from any R package. Function code from additional R packages is displayed in a dedicated Source Viewer pane and is read-only.

4.4. Navigating the script

There are several ways to navigate the code stored as a script in a separate file:

  • The above "Go to File / Function" option allows you to search within an open script file;
  • The Jump to Line command is used to jump to a specific line in the script.

You can also use options from the corresponding menu (Code Tools):



4.5. Two-way code navigation

When navigating through the code (especially when sequentially jumping from one function to another), it is often necessary to quickly return to the previous place where the code was edited. RStudio maintains a list of these edits and allows you to navigate from one to the other in any direction using the Back and Forward commands (available from the Edit menu and also in the upper left corner of the Code Editor window). The Back and Forward commands allow you to repeat the following steps:

  • Opening a document (or switching between bookmarks)
  • Go to function definition
  • Jump to a specific line of code
  • Accessing a function using the Function menu
The Back and Forward commands can be invoked using the keyboard shortcuts Ctrl + F9 / Ctrl + F10 (Cmd + F9 / Cmd + F10 on Mac computers).

5. Using command history

5.1. general information

While running RStudio creates a database of all commands that the user enters into the Console. It is possible to view this database using the History panel.

5.2. Command history overview

The History tab in one of the RStudio service panels is used to view the history of previously executed commands. The commands are displayed in the order they were executed (recent commands are at the bottom of the list) and are grouped by time:

5.3. Search command history

In the upper right corner of the list of previously executed commands there is a field for entering search queries (for example, plot). Search terms can be detailed by entering several words separated by spaces (for example, the name of a data table):



Once you find the command you want, you can also view other commands that were running at about the same time. To do this, click on the arrow located to the right of the execution time of the corresponding command:

5.4. Executing commands

The commands in the History panel can be selected and then used in two ways (in accordance with the names of the two buttons at the top left of the panel):

  • Send to Console - Sends the selected commands to the Console. Note, however, that the commands sent to the Console will not be executed until the Enter key is pressed.
  • Send to Source - Sends the selected commands to the active Code Editor document. If there are currently no active open documents in the Editor, a new document with no name will be created.

In the list of previously executed commands, you can select one or more lines:


6. Working directories and workspaces

6.1. general information

Given how R handles .RData files and its workspaces by default, it makes sense to organize your work so that files from different projects are stored in different folders. The material below describes the possibilities available in RStudio for organizing such a model of work.

6.2. Default working directory


Similar to the standard R version, RStudio is guided by the "original working directory" principle. Typically, this is the user's home folder. When starting RStudio, the following happens:

  • The .Rprofile file (if any) from the original working directory is executed.
  • Loads the .RData file (if any) from this folder into the R workspace.
  • Other actions described in the R service file are performed Startup.

If changes have been made to the workspace, when RStudio exits, a dialog box appears asking if you want to save this workspace as an .RData file in the current working folder. This behavior can be changed in RStudio settings (menu Tools -\u003e Options -\u003e R General) as follows:

  • Change the initial working directory
  • Activate / deactivate automatic loading of the .RData file from the original working folder R (Restore .RData into workspace at startup)
  • Choose whether to save the .RData file always (Always), never (Never), or ask about saving at the end of work (Ask).

6.3. Change working directory

The current working directory is displayed at the top of the Console window. There are several ways to change the working directory:

  • Use function setwd ()
  • Use Tools -\u003e Change Working Dir ...
  • On the Files tab, select More -\u003e Set As Working Directory

Be aware of the possible consequences of changing the working folder:

  • Any relative file references in your code will become invalid.
  • When finished, the .RData file will be saved to a new folder.

Since these side effects can lead to errors during code execution, it is recommended that you start from the folder corresponding to the current project and do not change it until the session ends.

If all files related to a particular project are stored in one folder, it makes sense to make it the source for R. Methods for this will vary depending on the operating system. However, on all platforms, installing RStudio associates it with .RData, .R, and other R-related files. When opening such files, RStudio will automatically make the working folder the one in which the opened file is stored. However, remember that if RStudio is already running, opening new associated files will not change the working folder.

The following commands can be used to save the workspace to the R working folder or load the space from the working folder during an active RStudio session:

Remember that the load () function will add the workspace to be loaded to the current one. Therefore, if there are objects with the same names in the active and loaded spaces, then the objects from the loaded space will replace the objects of the same name in the active space. This can lead to undesirable consequences. Therefore, it might make sense to clear the active space before loading a new workspace. This can be done with the following command:


The Workspace tab also has options for performing the above operations:

  • Loads a project and displays its name in the Projects toolbar (located in the far right corner of the program's working window).
  • 7.3. Working with projects

    Opening a project

    There are several ways to open projects:

    • Using the Open Project command, available from the Projects tab of the main menu and toolbar, to navigate to a previously created project file (for example, MyProject.Rproj).
    • Selecting a project from the list of recently edited projects (this option is also available from the Projects tab of the main menu and from the toolbar).
    • Double click on the project shortcut file (see above).

    When opening a project in RStudio, the following actions are performed:

    • A new R session is started;
    • The commands are executed from the service file.Rprofile (if there is one in the main project folder);
    • The .Rhistory file is loaded from the project folder into the History panel and is used to navigate through previously executed commands;
    • The project directory becomes the R working directory;
    • Previously edited R-code scripts open in the Code Editor.
    • Other RStudio settings (for example, active bookmarks, window splitter state, etc.) are reverted to the state they were before the project was closed.

    Exiting the project

    When you choose the Quit R command from the File section of the main menu, the Close Project command from the Project toolbar, or simply open a new project, the following happens:

    • The .RData and / or .Rhistory files are written to the project folder (if the current program settings suggest this);
    • A list of scripts included in the project is saved for the opportunity to open them next time;
    • Other RStudio settings are retained (see above);
    • The current R session ends.

    Working with multiple projects at the same time

    You can work on multiple projects at the same time by simply launching the appropriate number of copies of RStudio. This can be done in two ways:

    • Use the Open Project in New Window command located in the Project section of the main menu.
    • Open multiple projects from the file browser by clicking on the appropriate shortcuts.
    Setting up projects

    There are several options to customize the behavior of each specific project in RStudio. These options are available by the Project Options command from the Project section of the main program menu:


    General Tab (General): Using this tab, you can change the global settings for the behavior of projects. If you do not need to change them, leave the Default value. The following options are available:
    • Restore .RData into workspace at startup - loads the .RData file (if there is one) from the original working directory R. If the .RData file is large, it is best to select "No" for this option. This will significantly reduce the startup time of the program.
    • Save workspace to .RData on exit - saves the workspace as an .RData file when exiting the program. The options are Default (global settings are used), Yes, No, and Ask. Please note: if the workspace has not been changed, you will not be prompted to save changes, even if the value is "Ask".
    • Always save history (even when not saving .RData) - allows you to make sure that the .Rhistory file with the command history is always saved, even if you chose not to save the .RData file when exiting the program.
    Editing Tab(Editing):
    • Index R source files - allows you to make scripts with R-code from a specific project indexed for navigation through the code (see above). Usually this option should be enabled, but if there are "thousands" of files in the project folder, this option can be disabled to avoid slowing down the program.
    • Insert spaces for tab - sets the action of the Tab key, i.e. how many spaces should appear when pressed.
    • Text encoding - sets the text encoding in script files. Files whose encoding does not match the specified one can still be opened and recognized correctly by using the Reopen with Encoding command from the File menu.
    Version Control Tab(Version control):
    • Version control system - allows you to specify the system that will be used for version control. RStudio automatically detects version control by scanning the .git or.svn folder. Accordingly, it is better not to change this setting. The reasons for making changes can be the following:
    1. The project contains both a .git folder and an.svn folder, and you want to specify clearly which control system should be used.
    2. The project is not tied to any source control system and you want to add a logical git repository (equivalent to running git init from the root of the project).
    • Origin - displays the source of the version control system.

    What does data loss mean for a modern person? Compare this to a disaster! After all, all important information is now stored in digital form on various media, and it costs nothing to lose it. Accidentally delete data, catch a malicious virus that will destroy important documents, unexpectedly crash and damage the file system or inadvertently pulled out a USB flash drive, followed by the sentence “ Format?"And that's it ...

    Now there are no family photos, favorite music and films, and even worse when you lose documents related to work or study: term papers, diplomas, quarterly reports, etc. For such cases, data recovery programs have been written that are able to scan the medium and help you get your data back. We will look at one of the best recovery programs today.

    R-Studio is a software package from the company. to recover data after deleting, formatting, damage to the file system. It can work with most popular media: flash drives, memory cards, hard drives, CDs, DVDs and floppy disks, as well as with RAID arrays and even recover files remotely.

    Compatible versions of the program have been developed for Linux, Mac and Windows operating systems, including those in Russian. Among the distinctive features of R-Studio are:

    • Creating and working with disk or partition images
    • Reconstruction of disk arrays RAID
    • Support for most popular file systems
    • Data recovery over the network
    • Built-in hex editor

    R-Studio was originally developed for experienced users who have come across data recovery more than once, for system administrators, IT professionals. But don't be scared, because the program is simple and straightforward and it will be enough to study the illustrated instructions written by us and explaining.

    You can download the full Russian version of R-Studio or the portable version. Antivirus can swear at viruses, but there is no malware in the files. Verified!

    Instruction: how to use R-Studio

    We start by launching the program and the main disk browser window (disks panel). It displays all disks and drives that are connected to the computer and full information on them: type, size, file system, sector size, etc. We select the disk or device on which the files were located.

    Image # 1: Disk panel

    The easiest and fastest way would be to go directly to scanning, but it would be more correct to make a disk image and work with it, so as not to unnecessarily expose the data that could be further damaged or permanently deleted. The image will need free memory space commensurate with the size of the data occupying the disk being restored. In the program, click "Create Image" and in the window that opens, select the path where the created image will be stored, and click "Yes".

    Image # 2: Image creation

    Image # 3: Image creation process

    The imaging process depends on the size of the disk and can take several hours, so please be patient. After completion, we return to the main window, where we select "Open Image" and specify the path.

    Image # 4: Opening the image

    The image appeared in the disks panel and now you can start scanning without fear that the real data on the disk will be damaged. Click "Scan" and in the window that opens, click "Advanced". If we are only interested in some types of files, then go to the "Known file types" and select the ones that we need, thereby significantly reducing the search time. Otherwise, check the "Search for known file types" box to search for all files.

    Image # 5: Scan Settings

    You need to select the type of scan. It depends on how much time you are willing to spend on recovery and how much the device is. In this case, this is a 1.8 GB memory card and you can put a "detailed view" when the table of sectors and information about the objects found will be clearly displayed. If you are recovering a hard drive or a large device, then it is better to choose the less colorful and visual, but the fastest "No."

    Image # 6: Visual Scanning Process

    The scanning process has started, which can last from several minutes to several hours, depending on the amount of data, the selected file types and the speed of the system.

    Upon completion, the program will offer a list of files to restore. The easiest way is to right-click on the item "Recover all files", or you can recover only those that you need by ticking them and clicking "Recover marked".

    Image # 7: "Recover all files"

    In either case, you will be prompted to select a location to save your data. After that, the recovery process will take place, which can last several hours depending on the amount of data.

    Image # 8: Recovery options

    Image # 9: Data recovery process

    Note that R-Studio is not the fastest program to work with, but the amount and quality of data it recovers justifies this.