9.3 Read RData Files | Analytics Using R (2024)

9.3 Read RData Files

After reading in the raw data, as in a csv file, you do work, like creating new variables or modifying the ones that you have. While you can recreate this work by re-running your code, it is much easier to save your workspace in a *.RData file, especially if you have made a lot of changes/additions to the raw data.

The workspace represents your work. The *.RData file has the original data plus any changes that you made.

The easiest way to load the data into R is to double-click on the particular file yourfile.RData after you download it to your computer. This will open in RStudio only if you have associated the .RData files with RStudio. Otherwise the file will open in R.

To change your file associations, please see Change File Associations in Windows or Change File Associations in Mac.

You may want to set your working directory to where you stored the RData file..

These *.RData files are read into R with a load() statement, rather than a read statement.

load("yourdirectory/someworkspace.RData")

If you type ls() again, you can see that your data frame is showing up as in the workspace. The information can also be seen in the Environment Window.

9.3 Read RData Files  | Analytics Using R (2024)
Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5893

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.