Before being able to lazy-load your data you have to save your variables in a database that supports lazy load.
You can do this using the function tools:::makeLazyLoadDB
and later the function lazyLoad
.
To create the lazy load database. Say you have the variables X and Y, the you have to create an environment that contains them:
e=new.env(parent=emptyenv())
e$X = X
e$Y = Y
next you create the database:
tools:::makeLazyLoadDB(e,"DBNAME")
of course you can change DBNAME
.
You can the import it in R using lazyLoad("DBNAME")
.