Can I add to an existing lazy database in R without having to recreate everything?

database, lazy-loading, r

Solution

You need to save your workspace and try adding Dataframe Z into environment and again run tools:::makeLazyLoadDB(e,"mydb") , please find example below

e=new.env(parent=emptyenv());
e$x=10;
e$y=20;
tools:::makeLazyLoadDB(e,"mydb");
save.image();
lazyLoad("mydb");
e$z=40;
tools:::makeLazyLoadDB(e,"mydb");
save.image();
lazyLoad("mydb");

You can see your three Data frames x,y,z.

Problem

I created a database "mydb" that when run with lazyLoad("mydb") import in the workspace the (big) data.frames X and Y. I created "mydb" putting X and Y in an environment `e` and using the command `tools:::makeLazyLoadDB(e,"mydb")` Now I created a third data.frame Z (quite big as well). How can I add it to "mydb" without having to recreate the lazy objects for X and Y as well?

Original source

Related problems