Saturday, 4 July 2015

R : load : Reload the data saved with function save

“load” function reload datasets written with the function save.

Synatx
load(file, envir = parent.frame(), verbose = FALSE)

Parameter
Description
file
File to reload
envir
Environment where data should be loaded
verbose
If verbose is TRUE, then item names are printed while loading, else not.


> x <- 1:50
> y <- list(a = 1, b = TRUE, c = "oops")
> save(x, y, file = "xy.RData")
> 
> x<-10
> y<-20
> 
> x
[1] 10
> y
[1] 20
> 
> data <- load("xy.RData")
> data
[1] "x" "y"
> 
> x
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
> y
$a
[1] 1

$b
[1] TRUE

$c
[1] "oops"


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment