loadObject: Load saved data of class Object and use reObject as necessary

Description Usage Arguments Details Value Warning Author(s) See Also Examples

Description

Load the data from a file into the .GlobalEnv (or any other enviroment). If variables were converted to a list using unObject, this variables are converted to original object using reObject method.

Usage

1
loadObject(file=NULL, envir=.GlobalEnv, verbose=T, reobjectize=T, compatibilize=TRUE, ...)

Arguments

file

The file to load.

envir

The environment to load the data. The default is .GlobalEnv.

verbose

Displays progress.

reobjectize

Specify if reObject method should be called. Defaults to TRUE.

compatibilize

Compatibilze chromosomes built on previous versions.

...

Additional arguments to reObject

Details

Load the data from a file into the .GlobalEnv (or any other enviroment). If variables were converted to a list using unObject, this variables are converted to original object using reObject method.

Value

A data frame with variable names and class of loaded objects.

Warning

It could take some seconds for large and/or complex objects/files.

Author(s)

Victor Trevino

See Also

unObject, reObject.

Examples

 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
library(R.oo)  # needed library
o <- Object()
o$x = 1
o$y = 2
o$x
o$y
o
class(o)
names(o)
uo <- unObject(o)
uo
class(uo)
uoTempFile <- file.path(tempdir(), "uo.Rdata")
save(uo, file=uoTempFile)


### perhaps other session here
library(R.oo)
loadObject(uoTempFile)
uo
class(uo)
# the class is the original from the original object (o in this case)

### equivalent to:
library(R.oo)
load(uoTempFile)
uo <- reObject(uo)
uo
class(uo)

galgo documentation built on May 2, 2019, 4:20 a.m.