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

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