Reading and Saving data file in R session

Suppose you want to save an individual object in R and read it later.

Saving data file in R session
saveRDS(mydata, "logistic.rds")
Reading stored data from R session
mydata = readRDS("logistic.rds")
Note : You can define any name other than mydata.

Another way : Saving data file in R session
save (mydata,file="E:\\logistic.rdata")
Loading stored data from R session
load("E:\\logistic.rdata", ex <- new.env())
ls(ex)
Saving multiple objects in R session
save(mydata, data2, file="1.RData")
Saving everything in R session
save.image(file="1.RData")

R Tutorials : 75 Free R Tutorials

About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has close to 7 years of experience in data science and predictive modeling. During his tenure, he has worked with global clients in various domains like retail and commercial banking, Telecom, HR and Automotive.


While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*

Related Posts:

0 Response to "Reading and Saving data file in R session"

Post a Comment

Next → ← Prev